-
Hi there!
Need help on VB5. I tried number of times to Open MSAccess data(I protect with a password on it), when I run my program in VB5 & it prompt me "Run-time error 3031, Not a valid password, therefore I can't open it. Anyone can help me, how to decode MSAccess password in VB5 statement. Thanks
Rgds,
Sam
-
This is DAO
DBEngine.SystemDB = C:\MyPath\My.MDA"
DBEngine.DefaultUser = "MyUserName"
DBEngine.DefaultPassword = "MyPassword"
------------------
Marty
-
Thanks Marty, will try it out...
Rgds,
Sam
-
Hi Marty,
It still prompt me "Run-time error 3031, Not a valid password"
I protected MSAccess file with password(Not the Admin/User password).
Rgds,
Sam
-
-
Accessing a password protected MSAccess database:
Using DAO...
Code:
Dim db As DAO.Database
Set db = DBEngine(0).OpenDatabase("C:\YourDatabase.mdb", True, False, ";pwd=YourPassword")
Using ADO...
Code:
Dim cn as ADODB.Connection
Set cn = New ADODB.Connection
cn.Provider = "Microsoft.Jet.OLEDB.3.51"
cn.ConnectionString = "Data Source=C:\YourDatabase.mdb;Jet OLEDB :database password=YourPassword"
cn.CursorLocation = adUseClient
cn.Open
[This message has been edited by Gerald (edited 12-07-1999).]
-