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 gkittelson 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.

Guest_imported

New member
Jan 1, 1970
0
I'm trying to open a database secured by a password with an ASP page

The database, without a password, opens with the code shown below:

'Create a connection object
Set Conn = Server.CreateObject("ADODB.Connection")

'Select provider
Conn.Provider = "Microsoft.Jet.OLEDB.4.0"

'Select data source - the Kingswood database.
Conn.ConnectionString = "Data Source=" & Server.MapPath ("kingswood.mdb")

'Open the connection
Conn.Open

How do I modify this code to open the database when it has a password?
 
Conn.ConnectionString = "Data Source=" & Server.MapPath ("kingswood.mdb") & ";UID=userID;PWD=password"

:)

 
You don't have to have the UID in there just to clearify. You can have just the PWD for the Database.

Conn.ConnectionString = "Data Source=" & server.mappath("kingswood.mdb") & ";PWD=myDatabasePassword;"

-Ovatvvon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top