ACC: "Run-time error '3031': Not a valid password" Error MessageID: Q192028
|
Moderate: Requires basic macro, coding, and interoperability skills.
When you try to open a database programmatically, you may receive the
following error message, even though the password is correct:
Run-time error '3031':
Not a valid password.
When you manually set the database password to a password with fourteen characters (the limit), you cannot use that same password to programmatically open the database.
Set db = ws.OpenDatabase _
("C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb", _
False, False, "MS Access;PWD=FourteenCharac")
to read as follows:
Set db = ws.OpenDatabase _
("C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb", _
False, False, "MS Access;PWD=FourteenChara")
NOTE: This will programmatically open the Northwind.mdb database even
though the password is not correct.
Microsoft has confirmed this to be a problem in the products listed at the beginning of this article.
Sub OpenDB()
Dim db As Database
Dim ws As Workspace
Set ws = DBEngine.Workspaces(0)
' The default path to Northwind.mdb in Access version 7.0 is
' C:\MSOffice\Access\Samples\Northwind.mdb
Set db = ws.OpenDatabase _
("C:\Program Files\Microsoft Office\Office\Samples\Northwind.mdb", _
False, False, "MS Access;PWD=FourteenCharac")
Set ws = Nothing
Set db = Nothing
End Sub
Additional query words: wrong invalid incorrect
Keywords : kbdta MdlProb
Version : WINDOWS:7.0,97
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: May 13, 1999