Click to See Complete Forum and Search --> : How to Open MSAccess data with Password protected
samccw
Dec 5th, 1999, 09:05 PM
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
MartinLiss
Dec 5th, 1999, 09:10 PM
This is DAO
DBEngine.SystemDB = C:\MyPath\My.MDA"
DBEngine.DefaultUser = "MyUserName"
DBEngine.DefaultPassword = "MyPassword"
------------------
Marty
samccw
Dec 5th, 1999, 09:14 PM
Thanks Marty, will try it out...
Rgds,
Sam
samccw
Dec 6th, 1999, 04:48 PM
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
samccw
Dec 6th, 1999, 05:10 PM
Here's my Email samccw@excite.com
Gerald
Dec 7th, 1999, 01:02 AM
Accessing a password protected MSAccess database:
Using DAO...
Dim db As DAO.Database
Set db = DBEngine(0).OpenDatabase("C:\YourDatabase.mdb", True, False, ";pwd=YourPassword")
Using ADO...
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).]
samccw
Dec 8th, 1999, 05:15 PM
Thanks Gerald...
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.