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

Opening Access Database with Password with ADO 1

Status
Not open for further replies.

Zestman

Programmer
Mar 13, 2003
10
ZA
Hi All

I have a small MS Access Database that I open via VB6 ADO. I want to save a password to the database and did so in Access via Tools/Security after I opened it Exclusively

When adding the VB6 code :

Set Ecn = New ADODB.Connection
Ecn.ConnectionString = cmd
' (Note : The cmd is correctly defined)
Ecn.Open , "admin", "mypassword"

I get an error saying the workgroup file is missing.. I want this app to reside on a stand alone PC, so no user identification is really needed, just a simple password. I dont want anyone to be able to open the database vir Access.

Any ideas ??
 

Hi Zestman:

I ran into that problem. The solution that I found was to use the database password, not the user password. For example, a typical connection string from my programs (using VB6SP5, MS Jet 4.0, and ADO2.7) is:

Code:
m_cnnDB.ConnectionString = _
    "Provider=Microsoft.Jet.OLEDB.4.0;" & _
    "Data Source=" & m_strMyDBName & _
    ";Jet OLEDB:Database Password='" & m_strMyPassword & _
    "';Mode=ReadWrite;Persist Security Info=False;"

Cassie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top