Friday, August 27, 2010

VB6.0 MSAccess ConnectionString with Database Password

Public Sub cnOPEN()
mdbpassword = "k12i07s2002s"
mdbname = "bojpr2010.mdb"
If cn.State = 1 Then
cn.Close
End If
cn.Mode = adModeReadWrite
cn.Open "Provider=MSDataShape.1;Data Provider = Microsoft.Jet.OLEDB.3.51;Jet OLEDB:Database Password=" & mdbpassword & ";data source=" & App.Path & "\" & mdbname
End Sub

No comments: