Referencing a database with a password

  • Thread starter Thread starter Guest
  • Start date Start date
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?
 
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")
 
Back
Top