About MDE files

If your database contains Microsoft Visual Basic for Applications (VBA) code, saving your Microsoft Access database as an MDE file compiles all modules, removes all editable source code, and compacts the destination database. Your Visual Basic code will continue to run, but it cannot be viewed or edited. Saving your database as an MDE file secures you forms and reports without requiring users to log on or requiring you to create and manage the user accounts and permissions that are needed for user-level security.

Your database will continue to function normallyù-you can still update data and run reports. Additionally, the size of the database will be reduced due to the removal of the code, so memory usage is optimized, which will improve performance.

Saving your Access database as an MDE file prevents the following actions:

Considerations if you need to modify the design of forms, reports, or modules

Be sure to keep a copy of your original Access database. If you need to modify the design of forms, reports, or modules in an MDE file, you must modify the original Access database, and then resave it as an MDE file. Saving an Access database containing tables as an MDE file creates complications reconciling different versions of the data if you need to modify the design of the forms, reports, or modules later. For this reason, saving an Access database as an MDE file is most appropriate for the front-end database of a front-end/back-end application.

Code no longer secured with user-level security

In previous versions of Access, user-level security could be used with VBA modules. In Microsoft Access 2000 and later, all Visual Basic code for an Access database (.mdb) file or an Access project (.adp) file, including stand-alone modules and class modules (such as code behind forms and reports) must be secured by setting a password, or by saving the database as an MDE or ADE file, which removes the source code.

Consideration before saving your database as an MDE file

Some restrictions may prevent you from saving your Access database as an MDE file:

Additionally, if you define a database password or user-level security before saving an Access database as an MDE file, those features will still apply to an MDE file created from that database. If your Access database has a database password or user-level security defined and you want to remove these features, you must do so before saving it as an MDE file.

To save an Access database that was secured with user-level security as an MDE file, you must meet the following requirements before you can proceed:

About references and MDE files

If you try to create an MDE file from a Microsoft Access database (.mdb) or an add-in (.mda) that references another Access database or add-in, Access displays an error message and doesn't let you complete the operation. To save a database that references another database as an MDE file, you must save all databases in the chain of references as MDE files, starting from the first database referenced. After saving the first database as an MDE file, you must then update the reference in the next database to point to the new MDE file before saving it as an MDE file, and so on.

For example, if Database1.mdb references Database2.mdb, which references Database3.mda, you would proceed as follows:

  1. Save Database3.mda as Database3.mde.
  2. Open Database 2.mdb and change its reference to point to the new Database3.mde.
  3. Save Database2.mdb as Database2.mde.
  4. Open Database1.mdb and change its reference to point to the new Database2.mde.
  5. Save Database1.mdb as Database1.mde.

About saving a replicated database as an MDE file

A replicated database (either a replica or Design Master) cannot be saved as an MDE file. To save a replicated database as an MDE file, you must first remove replication.

Once a database is saved as an MDE file, it can be replicated; however, replication is only recommended in situations where no further changes need to be made to the original database. There is no way to make changes to the design of forms, reports, or code in the Design Master MDE file, and design changes made in the original database can't be synchronized with pre-existing MDE replicas. For this reason, if you need to make a design change to a replica set of MDE files, you must make that change in the original database, resave it as an MDE file, and then create and distribute an entirely new replica set from the new MDE file.