Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Database password

Status
Not open for further replies.

WilsonM

Programmer
Feb 5, 2001
22
CA
Hi,

I have a database that will be accessed by an excel file, my DB has a Password and I would like to know if it's possible to set that password in the code so that the user will not have to enter this password.

Thanks in advance,

Wilson
 
I believe that by using the DBENGINE.OpenDatabase method, you can open the database via passing a password as one of the parameters. Example (from the MS Access Help):

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"

I hope it was helpful.
Gary
gwinn7
 
I don't mean to come across the wrong way, but if you set the password in code, doesn't that defeat the purpose of having a password on the database in the first place?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top