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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running App that opens a Password-set Access DB

Status
Not open for further replies.

Micash

Programmer
Dec 11, 2000
54
0
0
I have created an application that utilizes an Access97 Database. I would now like to password protect the database. I need to know if there is a relatively easy way of coding in the password so that the application can access the data. Thanks very much! - Micash
 
Yes. If the database is password protected, you feed it the password on the open DB command. Look for the syntax on the help file. But the second or third filed is for password when establishing a connection.

Jeremy
 
Using DAO:

Dim db As Database
Set db = Workspaces(0).OpenDatabase("C:\aa\db1.mdb", False, False,"PWD=password")

Using ADO (and ODBC data source):

Dim cnn As New ADODB.Connection
Dim strCon As String
strCon = "Data Source=ODBCSource;UID=user;Password=password"
cnn.Open strCon

Simon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top