ACCESS: "Microsoft Access Was Unable to Create an MDE, ACCDE, or ADE Database" Error Message with a Database That You Cannot Compile

S’applique à : Microsoft Office Access 2003Microsoft Office Access 2007Access 2010

Moderate: Requires basic macro, coding, and interoperability skills.


This article applies to a Microsoft Access database (.mdb/.accdb) and to a Microsoft Access project (.adp).


Symptoms


When you try to save a Microsoft Access database as a ACCDE or MDE file in Access 2007 or Access 2010, you may receive the following error message
Microsoft Access was unable to create the .accde, .mde, or .ade file.
and the ACCDE file is not created.

When you try to save a Microsoft Access database as a MDE file, you may receive the following error message

Microsoft Access was unable to create an MDE database.
and the MDE file is not created.

When you try to save a Microsoft Access project as an ADE file, you may receive the following error message

Microsoft Access was unable to create an ADE database.
and the ADE file is not created.

Cause


You may receive this error message if either of the following is true:

  • There is an error in the Visual Basic for Applications code that prevents you from compiling the database or project.
  • There is a reference to an Access database (.mdb/.accdb) or an Access project (.adp).

Resolution


Correct any problems in the code that prevent you from compiling the database or project and remove any references to .mdb, .accdb, and .adp files. If you need to maintain a reference to a .mdb, .accdb, or .adp file, convert that file into an MDE, ACCDE or an ADE file, and then create a reference to the new file. You should now be able to convert the database or project to an MDE, ACCDE or an ADE file. 

More Information


Steps to Reproduce the Behavior

  1. Create a new database.
  2. Press ALT+F11 to open the Visual Basic Editor.
  3. On the Insert menu, click Module.
  4. Type the following code:
    Sub Generate_Compile_Error()
    MsgBoxx "This will cause an error"
    End Sub
  5. On the File menu, click Save projectname.
  6. Press ALT+F11 to return to Microsoft Access.
  7. On the Tools menu, point to Database Utilities, and then click Make MDE File.


    Note that you receive the error message that is mentioned in the "Symptoms" section of this article.

References


For additional information about other causes for this error message, click the article number below to view the article in the Microsoft Knowledge Base:

202304 ACC2000: "Microsoft Access Was Unable to Create an MDE Database" Error Message