How to open a database password protected in Access 2000

M

Mark90

Hi there!
I have trouble opening an access 2000 protected with password.
I am automating the access 2000 in VB6. My code starts like this....

....
x = getobject(,"Access.application.9")

x.opencurrentdatabase(dbname,...)
....

I found no way to open it except in access 2003 where in the
opencurrentdatabase it included the pwd parameter.

Is there another way to open it?
 
C

Chris Mills

This is for User Level Security, not Database Password which is considered
insecure :)

(I'm a bit rusty on this, but it's from VB5)


Dim strDatabase As String
Dim dbs as Database

DBEngine.SystemDB = "\...\system.mdw"
DBEngine.DefaultUser = "User"
DBEngine.DefaultPassword = "Password"

strDatabase = "\...\MyDatabase.mdb"
Set dbs = Workspaces(0).OpenDatabase(strDatabase)

Chris
 

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