eu uso uma funcao assim...
Public Function Abrir_BAse_Dados_FB() As Boolean
On Error GoTo erro
Dim conex_str As String
Dim bancodedados$, Server$, Porta$, User$, Senha$, PROVEDOR$
User = "SYSDBA"
Senha = "masterkey"
Server = "127.0.0.1" ' ou localhost"
DatabasePath = "C:Documents and SettingsBig PiscinaMeus documentosBig PiscinaProgramaçãoFireBirdBD_FB_FABRICA_01.FDB"
PROVEDOR = "Provider=IbOleDb.1"
With Conexao
.ConnectionString = PROVEDOR _
& ";Location=" & Server _
& ";Data Source=" & DatabasePath _
& ";User ID=" & User _
& ";Password=" & Senha _
& ";Extended Properties=character set=WIN1252;SQL Dialect=1;Extended Properties=Character Set=ISO8859_1;Persist Security Info=True"
Debug.Print .ConnectionString
.Open
End With
If Conexao.State = 1 Then
Abrir_BAse_Dados_FB = True
Else
Abrir_BAse_Dados_FB = False
End If
Exit Function
erro:
MsgBox Err.Number & " " & Err.Description
End Function
espero que ajude