ACC: "Run-Time Error '3031': Not a Valid Password" Error Message (192028)
The information in this article applies to:
- Microsoft Access for Windows 95 7.0
- Microsoft Access 97
This article was previously published under Q192028 Moderate: Requires basic macro, coding, and interoperability skills.
SYMPTOMS
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.
CAUSE
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.
RESOLUTIONMethod 1
Do not select a password that is longer than 13 characters if you need to
open the database programmatically.
Method 2
When you open the database programmatically, you need only include the
first 13 characters of the database password.
To make the example in the "Steps to Reproduce Problem" section work,
change the following line of code
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.
STATUS
Microsoft has confirmed this to be a problem in the products listed at the
beginning of this article.
Modification Type: | Minor | Last Reviewed: | 1/26/2005 |
---|
Keywords: | kbbug kbpending KB192028 |
---|
|