ACC2000: Database Password Prompt Appears After You Open a Database Using a Hyperlink or Visual Basic for Applications (VBA) Code (321905)
The information in this article applies to:
This article was previously published under Q321905 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb).
For a Microsoft Access 2002 version of this article, see 322860.
SYMPTOMS
When you open a database, a prompt appears for a database password, even though you may not have set a database password for the database.
CAUSE
You previously opened the database in one of the following ways:
- You used a hyperlink from another Microsoft Office program to open the database.
-or- - You used Microsoft Visual Basic for Applications (VBA) automation code to open the database.
While the database was open, you compacted it, either manually or by setting the Compact on Close attribute of the database. While you were compacting the database, a database password was unexpectedly set on the database.
RESOLUTION
After a database password is set in this way, you cannot access the database by opening it directly in Microsoft Access. To recover the information from the database, you must open the database by using either a hyperlink or VBA automation code. Then you must export each of the objects into a new database.
Opening the Database Using a Hyperlink- Create a new, blank database in Access.
- Close the database.
- Open Microsoft Word.
- On the Insert menu, click Hyperlink.
- Locate the database file that you cannot open directly in Access, and then select it.
- While holding down the CTRL key, click the hyperlink that you created in step 4.
- When the database opens, select an object that you want to export.
- On the File menu, click Export.
- Locate the database that you created in step 1, and then click Export.
- Repeat steps 7 through 9 for each object that you want to export.
Opening the Database Using VBA Automation Code- Create a new, blank database in Access.
- Close the database.
- Open the Microsoft Visual Basic Editor in any Office program.
- On the Tools menu, click References.
- Click to select the Microsoft Access 9.0 Object Library, and then click OK.
- On the Insert menu, click Module.
- Type or paste the following code into the module.
Dim oAcc As Access.Application
Sub OpenAccessFile()
Set oAcc = GetObject("C:\MyPath\MyDatabase.mdb")
' Replace "C:\MyPath\MyDatabase.mdb" with the path to your database.
oAcc.Visible = True
End Sub
- Run the procedure.
- When the database opens, select an object that you want to export.
- On the File menu, click Export.
- Locate the database that you created in step 1, and then click Export.
- Repeat steps 9 through 11 for each object that you want to export.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. REFERENCESFor additional information about a similar issue, click the article number below
to view the article in the Microsoft Knowledge Base:
243895 ACC2000: Database Password Appears Even Though It Was Never Set
Modification Type: | Major | Last Reviewed: | 6/25/2004 |
---|
Keywords: | kbprb KB321905 |
---|
|