Connecting with .mdb

My database is on access2000 , name of db: Pir.mdb
i was using the code:

 'MyCin=new connection

MyCin.Open "Provider=Microsoft.jet.oledb.4.0;data source =" & App.Path & "\Pir.mdb"

and it works fine, but when i set up a password on the database
i tried this code but it didnt work?!!

MyCin.Open "Provider=Microsoft.jet.oledb.4.0;data source =" & App.Path & "\Pir.mdb",,"mypassword"

Any suggestions ...

Thanks


LVL 1
Mahdi MansourDesign Monitoring & Evaluation ManagerAsked:
Who is Participating?
 
SethiConnect With a Mentor Commented:
Set the password like this:

MyCin.Open "Provider=Microsoft.jet.oledb.4.0;data source =" & App.Path & "\Pir.mdb;Jet OLEDB:Database Password=mypassword"
0
 
SethiCommented:
For your future references look at the following two sites for correct connection string formats:

http://www.connectionstrings.com
http://www.able-consulting.com/ADO_Conn.htm
0
 
DarkoLordCommented:
A useful utility called Mz-Tools (http://www.mztools.com/) can creates a connection string for you and copies it to clipboard ;)

Darko
0
All Courses

From novice to tech pro — start learning today.