Referencing a database with a password

G

Guest

I am trying to reference another Access database with a database password.
However when I try to use the OpenDatabase method I keep getting an "invalid
password" error. I know the password is correct so I must not be assigning it
properly. The code looks like the following:

Set wrkspc = CreateWorkspace("", "admin", "", dbUseJet)
Set db = wrkspc.OpenDatabase("C:\Temp\RateDBSecurity.mdb", ,
False,";pwd=password1")

Can anyone tell me what I'm doing wrong?
 
D

Douglas J. Steele

While the Help file says that the 2nd and 3rd parameters of the OpenDatabase
method are optional, you must supply values for both of the them if you want
the 4th parameter (the password) to be recognized.

See whether the following works for you:

Set db = wrkspc.OpenDatabase("C:\Temp\RateDBSecurity.mdb", False,
False,";pwd=password1")
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top