Beispiel #1
0
        private void ReturnDataBaseAccess(bool bLoadConfiguration, out mdlDataBaseAccess.clsDataBaseAccess cls_dba_ConnectionDB)
        {
            mdlDataBaseAccess.clsDataBaseAccess cls_dba_ConnectionReturn = null;
            if (bLoadConfiguration)
            {
                vCarregaDadosConfiguracao();
            }
            switch (m_enumDataBaseType)
            {
            case TiposBancoDados.Jet40:
                cls_dba_ConnectionReturn = new mdlDataBaseAccess.clsDataBaseAccessOleDbJet40(ref m_cls_ter_TratadorErro, m_strDataBaseAccessJet40Path, m_strDataBaseAccessJet40User, m_strDataBaseAccessJet40Password);
                break;

            case TiposBancoDados.SqlServer:
                cls_dba_ConnectionReturn = new mdlDataBaseAccess.clsDataBaseAccessSqlServer(ref m_cls_ter_TratadorErro, m_strDataBaseAccessSqlServerHost, m_strDataBaseAccessSqlServerPort, m_strDataBaseAccessSqlServerDataBaseName, m_strDataBaseAccessSqlServerUser, m_strDataBaseAccessSqlServerPassword);
                break;

            case TiposBancoDados.MySql:
                cls_dba_ConnectionReturn = new mdlDataBaseAccess.clsDataBaseAccessMySql(ref m_cls_ter_TratadorErro, m_strDataBaseAccessMySqlHost, m_strDataBaseAccessMySqlPort, m_strDataBaseAccessMySqlUser, m_strDataBaseAccessMySqlPassword, m_strDataBaseAccessMySqlDataBaseName);
                break;
            }
            if (m_bDevelopMode)
            {
                cls_dba_ConnectionReturn.SystemMode = mdlDataBaseAccess.Mode.Developer;
            }
            else
            {
                cls_dba_ConnectionReturn.SystemMode = mdlDataBaseAccess.Mode.User;
            }
            cls_dba_ConnectionDB = cls_dba_ConnectionReturn;
        }
Beispiel #2
0
        private bool bDataBaseConfiguratedRight(bool bLoadConfiguration)
        {
            bool bRetorno = false;

            if (bLoadConfiguration)
            {
                vCarregaDadosConfiguracao();
            }
            mdlDataBaseAccess.clsDataBaseAccess cls_dba_ConnectionDB = null;
            switch (m_enumDataBaseType)
            {
            case TiposBancoDados.Jet40:
                cls_dba_ConnectionDB = new mdlDataBaseAccess.clsDataBaseAccessOleDbJet40(ref m_cls_ter_TratadorErro, m_strDataBaseAccessJet40Path, m_strDataBaseAccessJet40User, m_strDataBaseAccessJet40Password);
                bRetorno             = bDataAccessRight(ref cls_dba_ConnectionDB);
                break;

            case TiposBancoDados.SqlServer:
                cls_dba_ConnectionDB = new mdlDataBaseAccess.clsDataBaseAccessSqlServer(ref m_cls_ter_TratadorErro, m_strDataBaseAccessSqlServerHost, m_strDataBaseAccessSqlServerPort, m_strDataBaseAccessSqlServerDataBaseName, m_strDataBaseAccessSqlServerUser, m_strDataBaseAccessSqlServerPassword);
                bRetorno             = bDataAccessRight(ref cls_dba_ConnectionDB);
                break;

            case TiposBancoDados.MySql:
                cls_dba_ConnectionDB = new mdlDataBaseAccess.clsDataBaseAccessMySql(ref m_cls_ter_TratadorErro, m_strDataBaseAccessMySqlHost, m_strDataBaseAccessMySqlPort, m_strDataBaseAccessMySqlUser, m_strDataBaseAccessMySqlPassword, m_strDataBaseAccessMySqlDataBaseName);
                bRetorno             = bDataAccessRight(ref cls_dba_ConnectionDB);
                break;
            }
            return(bRetorno);
        }