MS-Access / Getting Started

Using the decompile option

A little known start-up, command-line option is called /decompile. You may have seen other Access command-line options, such as /nostartup, /cmd, and /compact. The /decompile option starts Access in a special way and, when a database is opened, saves all VBA modules as text. This works with module objects and all the code behind forms and reports.

To decompile your application, follow these steps:

  1. Go to the Windows Start menu Run command.
    The Run window appears.
  2. In the Open text box, type msaccess /decompile and click Open.
  3. Open your application as you normally would, holding down the Shift key while you click on OK.
    This prevents start-up forms or autoexec macro processes from running. You don't want the database to run code that forces even a single module to be compiled.
    Access appears to start as usual, but the database may take several minutes to open if it contains a lot of data or VBA code. At this point, the real question is whether the database gets sufficiently smaller, runs faster, and stays compiled after it's compiled and compacted.
  4. After the database window is displayed, close Access.
    Don't just close the database window - actually exit Microsoft Access.
  5. Restart Access.
  6. Open your database, open any module, and choose Debug → Compile Project Name.
  7. After the database compiles, close the module, return to the Access window, and compact and repair the database.
    You should find that Access runs these procedures much faster than usual.

If you're ready to release your application for a real test by the users, follow these steps to insure a clean-running system:

  1. Reboot your computer to clean up memory.
  2. Create a new Access database and import all the objects.
  3. Restart Access by using the /decompile option while holding down the Shift key. Close Access after the database window is displayed.
  4. Restart Access normally while holding down the Shift key.
  5. Compile the database.
  6. Compact and repair the database.

By releasing a clean, fully compiled and compacted system, your application runs faster and has fewer technical or maintenance problems.

Caution: Make sure that you immediately exit Access after it finishes decompiling and then start Access again before running Compile Project Name or Compact and Repair Database.

[Previous] [Contents] [Next]