Can you supply ACCDB's password in OpenDatabase method?

M

Montgomery-Tim

Can you supply the password in Visual Basic code for an ACCDB file that you
wish to open using the OpenDatabase method?
 
D

Daniel Pineault

The following is pulled from the Access help file


Syntax

Set database = workspace.OpenDatabase (dbname, options, read-only, connect)

....

The connect argument is expressed in two parts: the database type, followed
by a semicolon (;) and the optional arguments. You must first provide the
database type, such as "ODBC;" or "FoxPro 2.5;". The optional arguments
follow in no particular order, separated by semicolons. One of the parameters
may be the password (if one is assigned). For example:

"FoxPro 2.5; pwd=mypassword"

So the answer to your question is YES, simply add it as part of your connect
argument
--
Hope this helps,

Daniel Pineault
http://www.cardaconsultants.com/
For Access Tips and Examples: http://www.devhut.net
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

Top