how to open an mdb file has a database password form another mdb



I have the data in an mdb file secured.
I wrote this to link to that mdb file

Set Dbnd = DBEngine.Workspaces(0).OpenDatabase("c:\DataFiles\acc2007.mdb",
False, False)

the error message "not a valid password"

how to set dbengine with password

Daniel Pineault

If you check the help file for 'OpenDatabase Method' you see in the input
variables 'connect' which description is

"Optional. A Variant (String subtype) that specifies various connection
information, including passwords. "

so try adding the 4th input variable and you should be good to go.
Hope this helps,

Daniel Pineault
For Access Tips and Examples:
Please rate this post using the vote buttons if it was helpful.

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