Can you supply ACCDB's password in OpenDatabase method?

  • Thread starter Thread starter Montgomery-Tim
  • Start date Start date
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?
 
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.
 
Back
Top