Trap the error that will be raised if you try to open it without the
password?
Public Sub TestPass()
Dim db As DAO.Database
Dim boolOpen As Boolean
On Error GoTo ErrorHandler
Set db = DBEngine.OpenDatabase(path/name here)
boolOpen = True
db.Close
boolOpen = False
Set db = Nothing
MsgBox "No, it's not password protected."
ExitProcedure:
If Not db Is Nothing Then
If boolOpen Then
db.Close
boolOpen = False
End If
Set db = Nothing
End If
Exit Sub
ErrorHandler:
Select Case Err
Case 3031
MsgBox "Yes, it's password protected."
Case Else
MsgBox Err.Number & ": " & Err.Description
End Select
Resume ExitProcedure
End Sub