I have an Microsoft Access Database with a password that I know it.
My trouble is how can I open this database in Visual Basic.
I need a sintaxe of opendatabase command.
Thanks
Here is an example opening a connection using ADO.
Public Sub OpenDB()
Dim strDB As String
strDB = "c:\db\ww.mdb"
'open the connection
Set cn = New ADODB.Connection
cn.Provider = "Microsoft.Jet.OLEDB.4.0"
cn.CursorLocation = adUseClient
cn.Open strDB
End Sub
Dim password As String
password = "edderic"
Dim strPath As String
Dim db As DAO.Database
strPath = IIf(Right$(App.Path, 1) <> "\", App.Path & "\", App.Path)
strAccessFile = "Scriptie01.mdb"
Set db = appAccess.DBEngine.OpenDatabase(strPath & strAccessFile, False, False, "MS Access;pwd=" & password) Eric De Decker
vbg.be@vbgroup.nl
Licence And Copy Protection AxtiveX
Source CodeBook for the programmer
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.