示例#1
0
        /// <summary>
        /// Método que linka aos bancos de dados por meio do MDAC 2.8
        /// </summary>
        public void conectar()
        {
            if (DB4.State == 0)
            {
                DB4.CursorLocation   = CursorLocationEnum.adUseServer;
                DB4.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + endereco + "BD4.mdb;Persist Security Info=False;Jet OLEDB:Database Password=''";
                DB4.Open();
            }

            if (Contas.State == 0)
            {
                Contas.CursorLocation   = CursorLocationEnum.adUseServer;
                Contas.ConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + endereco + "contas.mdb;Persist Security Info=False;Jet OLEDB:Database Password=495798";
                Contas.Open();
            }

            if (Small.State == 0)
            {
                Small.CursorLocation = CursorLocationEnum.adUseServer;
                //Small.ConnectionString = @"Dsn=Small;Driver={Firebird/InterBase(r) driver};dbname=100.0.0.250:C:/base/SMALL.GDB;charset=NONE;uid=SYSDBA";
                //Small.ConnectionString = @"Dsn=small_local;Driver={Firebird/InterBase(r) driver};dbname=C:/base/SMALL.GDB;charset=NONE;uid=SYSDBA";
                Small.ConnectionString = endSamll;
                Small.Open();
            }
        }
示例#2
0
 /// <summary>
 /// Método retorna objeto do tipo ADODB.Connection para o banco de dados Small.gdb
 /// </summary>
 /// <returns></returns>
 public Connection getSmall()
 {
     if (Small.State == 0)
     {
         Small.CursorLocation = CursorLocationEnum.adUseServer;
         //Small.ConnectionString = @"Dsn=Small;Driver={Firebird/InterBase(r) driver};dbname=100.0.0.250:C:/base/SMALL.GDB;charset=NONE;uid=SYSDBA";
         //Small.ConnectionString = @"Dsn=small_local;Driver={Firebird/InterBase(r) driver};dbname=C:/base/SMALL.GDB;charset=NONE;uid=SYSDBA";
         Small.ConnectionString = endSamll;
         Small.Open();
     }
     return((Small.State == 0) ? null : Small);
 }