ADO connection in VBA using a system database

F

Fotios Lindiakos

Please help. I am just looking for an example of how to connect to an
Access database in VBA code. I have an mdb file, and mdw file, a user name,
and a password. I have not used ADO before and am completely lost.

--
Frank Lindiakos
Application Developer
WeberSystems Inc.
[email protected]
[email protected]
 
E

Ed

Try this:

Sub ADOOpenSecuredDatabase()



Dim cnn As New ADODB.Connection



cnn.Provider = "Microsoft.Jet.OLEDB.4.0"

cnn.Properties("Jet OLEDB:System database") = "c:\sysdb.mdw"

cnn.Open "Data Source=c:\nwind.mdb;User Id=Admin;Password=password;"



End Sub
 
¹

¹Ú¹®¼ö

Fotios Lindiakos said:
Please help. I am just looking for an example of how to connect to an
Access database in VBA code. I have an mdb file, and mdw file, a user name,
and a password. I have not used ADO before and am completely lost.

--
Frank Lindiakos
Application Developer
WeberSystems Inc.
[email protected]
[email protected]
 
Top