'Referencie no seu projeto o ADO 2.X
'Coloque isso em um módulo avulso:
Public cnBd As ADODB.Connection
Public rst As New ADODB.Recordset
Public Sub ConectarBd()
On Error GoTo final
Dim sPath As String
'***Abrindo a base de dados com senha
Set cnBd = New ADODB.Connection
cnBd.CursorLocation = adUseClient '**O cursor será gerado ao lado docliente sPath = App.Path & "BancoDados.mdb"
'****************Abre bd
cnBd.Open "PROVIDER=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=" & sPath & ";Jet OLEDB:Database Password=suasenha;"
Screen.MousePointer = 0
Exit Sub
final:
MsgBox Err.Description, vbInformation, Err.Number
End Sub