Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

ACC2000: Database Password Prompt Appears After You Open a Database Using a Hyperlink or Visual Basic for Applications (VBA) Code


View products that this article applies to.

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.

↑ Back to the top


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.

↑ Back to the top


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

  1. Create a new, blank database in Access.
  2. Close the database.
  3. Open Microsoft Word.
  4. On the Insert menu, click Hyperlink.
  5. Locate the database file that you cannot open directly in Access, and then select it.
  6. While holding down the CTRL key, click the hyperlink that you created in step 4.
  7. When the database opens, select an object that you want to export.
  8. On the File menu, click Export.
  9. Locate the database that you created in step 1, and then click Export.
  10. Repeat steps 7 through 9 for each object that you want to export.

Opening the Database Using VBA Automation Code

  1. Create a new, blank database in Access.
  2. Close the database.
  3. Open the Microsoft Visual Basic Editor in any Office program.
  4. On the Tools menu, click References.
  5. Click to select the Microsoft Access 9.0 Object Library, and then click OK.
  6. On the Insert menu, click Module.
  7. 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
    					
  8. Run the procedure.
  9. When the database opens, select an object that you want to export.
  10. On the File menu, click Export.
  11. Locate the database that you created in step 1, and then click Export.
  12. Repeat steps 9 through 11 for each object that you want to export.

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.

↑ Back to the top


References

For 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

↑ Back to the top


Article Info
Article ID : 321905
Revision : 3
Created on : 1/1/0001
Published on : 1/1/0001
Exists online : False
Views : 268