Microsoft KB Archive/321905

From BetaArchive Wiki

Article ID: 321905

Article Last Modified on 6/25/2004



APPLIES TO

  • Microsoft Access 2000 Standard Edition



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

  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.


STATUS

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

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



Additional query words: prb

Keywords: kbprb KB321905