I'm a new VB programmer. Here is my code. When my ms access database have no secure password, it's work (strpassword=""). But, when i put a secure password to my ms access database (pass), i can't open the database.
Can you help me. Thank you!
Note: the coding will be very helpfull.
Public Sub SetDB(strpassword As String)
Dim path As String
path = App.path
' Dim DB As DAO.Database
' strpassword = "pass"
On Error GoTo Erreur
Set DB = OpenDatabase(path & "\datbase.mdb", , , strpassword)
Exit Sub
Erreur:
MsgBox "Can’t open database. (datbase.mdb)", vbCritical, "Erreur"
End
End Sub
Private Sub Form_Load()
Dim strpassword As String
SetDB strpassword
…..