'-------------------------------------------------------------------------
Public ConexaoADO As ADODB.Connection
Public SENHAbanco, USERbanco, IPbanco, DriveBanco, BANCO, CN_String As String
'---------------------------------------------------------------------------
Public Sub SU_Conecta()
10 On Error GoTo SU_Conecta_Error
20 SENHAbanco = "masterkey"
30 USERbanco = "SYSDBA"
40 IPbanco = "127.0.0.1"
50 DriveBanco = "E" 'DRIVER ONDE ESTA O BANCO FIREBIRD
60 BANCO = DriveBanco & ":BancosFirebirdBANCO.gdb" 'NOME DA PASTA E BANCO DE DADOS
70
80 Set ConexaoADO = New ADODB.Connection
'driver IbOLEDB
90 ConexaoADO.Open "Provider=IbOleDb;Location=" & IPbanco & ";Data Source=" & BANCO, USERbanco, SENHAbanco & ";Extended Properties='sql Dialect=3;Character Set=ISO8859_1;Collate = PT_BR'"
'driver ZSTYLE IBOLE
100 ' ConexaoADO.Open "Provider=ZStyle IBOLE Provider;Password=" & SENHAbanco & ";User ID=" & USERbanco & ";Data Source=" & BANCO & ";SQL Dialect=3;Logging Level=0;Silent mode=True;Lock resolution=1;Isolation level=4096"
110 CN_String = ConexaoADO.ConnectionString
120 ConexaoADO.CursorLocation = adUseClient
170 Exit Sub
180 On Error GoTo 0
190 Exit Sub
SU_Conecta_Error:
200 MsgBox "Erro Interno de número " & Err.Number & " - " & Err.Description & " - linha " & Erl & " na procedure SU_Conecta no Módulo Conexao_ADO - " & UCase(CN_String), vbCritical, "Conexao_ADO"
End Sub