ADO:
dim cn as new ADODB.Connection
cn.ConnectionString="Provider=Microsoft.JET.OLEDB.4.0;Data Source=" & app.path & "\test.mdb;Jet OLEDB Database:password=" & yourpass
cn.openDAO:
dim cn as Database
set cn=opendatabase(app.path + "\test.mdb",false,false,";pwd=" & yourpass )
dim cn as new ADODB.Connection
cn.ConnectionString="Provider=Microsoft.JET.OLEDB.4.0;Data Source=" & app.path & "\test.mdb;Jet OLEDB Database:password=" & yourpass
cn.openDAO:
dim cn as Database
set cn=opendatabase(app.path + "\test.mdb",false,false,";pwd=" & yourpass )
cnn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\temp\Nwind.mdb;Persist Security Info=False;Jet OLEDB:Database Password=MyPW"
piip
Dim PathName As String
Dim Password As String''''''''给变量付值
With con
.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;data source=" & PathName & ";jet oledb:database password=" & Password
End With
Dim PathName As String
Dim Password As String''''''''给变量付值
With con
.ConnectionString = "PROVIDER=Microsoft.Jet.OLEDB.4.0;data source=" & PathName & ";jet oledb:database password=" & Password
End Withcon.open '刚才忘了