Here's the syntax, I'm not sure if the method you use makes a difference:
OFile = your database's name (with full path)
Pass1 = your database's password
Set db = OpenDatabase(OFile, False, False, ";pwd=" & Pass1)
If Err.Number = 3031 Then
MsgBox "The password you entered is not valid. Please...