Fixing file corruption in Microsoft Access

Andrew Comeau   January 19, 2016   Comments Off on Fixing file corruption in Microsoft Access

Microsoft Access is the database portion of the Microsoft Office suite. It serves as a great tool for creating small applications to serve local reporting needs within departments and even small companies. It can be invaluable to power users who want to organize some data and generate reliable reports and perhaps learn more about database principles and programming at the same time. It also has some very powerful tools for designing flexible user entry forms and attractive report solutions.

For all of the versatility found within Microsoft Access and its programming language, Visual Basic for Applications (VBA), it does have a couple of quirks as a database solution. One of them is that the MDB and ACCDB file formats (depending on version) are susceptible to corruption as database designers add more features to their home-grown applications. Sometimes errors can creep in to the compiled source code that advanced users write to add functionality to their Access forms and reports. These errors can cause Access to crash unexpectedly whenever that code is accessed by the database and prevent the designer from fixing them by disabling the VBA environment.

Microsoft Access error message.

Corruption in Microsoft Access database files can sometimes cause the program to stop working.

Microsoft Access features a Compact and Repair feature that will remove unneeded temporary information from files but this is sometimes not enough. Another solution that might fix the problem is the use of the /decompile command-line switch when starting Microsoft Access.

"C:\Program Files (x86)\Microsoft Office\Office14\MSACCESS.EXE" /decompile

The compiled source code from the first file opened in Access after the /decompile switch is used will be removed and then the designer can recompile the VBA code using the Debug >> Compile command in the VBA environment. This might expose the original error that led to the corruption.

compile

This article was adapted from the original article on Drewslair.com where you can find more information about Microsoft Access and other database software

Categories

About Andrew Comeau

Organizer of the Ocala I.T. Professionals. Software developer and consultant based in Ocala, Florida.