Chapter 24: Optimizing Access Applications
877
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.
Detecting an uncompiled database and automatically
recompiling
Making sure that a database is always in a compiled state is very important. If you release a data-
base as an .accdb file, your customers may make changes to the application and then complain
because it’s running slowly. Although some of your customers may be serious developers, most
often the users who make changes to Access databases don’t understand compiling or compacting
a database.
Tip
To see if your database is compiled, open the Visual Basic window for any module, display the Debug window
at the bottom of the editor, and type? IsCompiled, as shown in Figure 24.16. If the database is compiled, it dis-
plays True. If it’s in a decompiled state, it displays False.
To solve this problem of changes being made by users who don’t understand compiling or compact-
ing a database, you can create an interface that automatically detects whether the database is not in a
compiled state and then gives the user the option of compiling the application. This automatic detec-
tion runs each time the database is opened. The user still has to compact the database, but the form
takes care of compiling the database, the part many users have trouble comprehending.
If you’re ready to release your application for a real test by the users, follow these steps to insure a
clean-running system:
- Reboot your computer to clean up memory.
- Create a new Access database and import all the objects.
- Restart Access by using the /decompile option while holding down the Shift key. Close
Access after the database window is displayed. - Restart Access normally while holding down the Shift key.
- Compile the database.
- 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.
The six steps to large database success