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!

Open mdb database with VB

Status
Not open for further replies.

ofsouto

Programmer
Apr 29, 2000
185
0
0
BR
Dear Sirs

I protected my system database (.MDB) with password and now I need to know how can I open it with VB code.

Thanks
 
Pass the password and user name with the connection string to the DB
 
Sample below:
Assume that ADO is referenced within project

Dim cnnNorthwind As ADODB.Connection

'Create the connection.
cnnNorthwind.Open "Provider=Microsoft.Jet.OLEDB.4.0;" & _
"Data Source=C:\Program Files\Microsoft" & _
"Office\Office\Samples\Northwind.mdb;" & _
&quot;User Id=<UserName>;&quot; & _
&quot;Password=<password>;&quot;

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top