Database password prompt appears after you open a database by using a hyperlink or by using Visual Basic for Applications (VBA) code in Access 2002

Article translations Article translations
Article ID: 322860 - View products that this article applies to.
This article was previously published under Q322860
This article has been archived. It is offered "as is" and will no longer be updated.
Moderate: Requires basic macro, coding, and interoperability skills.

This article applies only to a Microsoft Access database (.mdb).

For a Microsoft Access 2000 version of this article, see 321905.
Expand all | Collapse all

On This Page

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

  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 10.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.

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article.
Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.

Properties

Article ID: 322860 - Last Review: October 24, 2013 - Revision: 1.0
Applies to
  • Microsoft Access 2002 Standard Edition
Keywords: 
kbnosurvey kbarchive kbdatabase kbautomation kbvba kbprb KB322860

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com