I have an Access database application and I would like to know the proper way of decompiling and recompiling it.
To Decompile an Access database you'll need to create a shortcut with the following elements:
All together, then, the shortcut would look something like the following:
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\users\tim\documents\Mydatabase.mdb" /decompile
Obviously, the paths will be different on your system.
I'd recommend making a backup of your database before running this command.
If you have any startup code in your database you should hold down the shift key to bypass the startup code execution.
Once the database opens, you can compact and repair the database to ensure optimal performance.
After the compact and repair, you can recompile the VBA code by opening any module and using the Debug Compile [DatabaseName]
command.
If this is something you want to do frequently, you can create an "Access Decompile" shortcut in your SendTo Menu. Once you have this shortcut in the SendTo Menu you'll be able to right-click on any Access database and select "Send To --> Access Decompile", which is much easier than having to create a shortcut to the specific database.
Follow these steps to customize the Send To menu with an Access Decompile shortcut
Create a shortcut to the Access executable.
Append the /decompile flag in the Target for the shortcut. The shortcut will look like this:
"C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" /decompile
Open Windows Explorer and paste the following into the address bar:
%APPDATA%\Microsoft\Windows\SendTo
Copy the shortcut you created into the SendTo Folder.
The Access Decompile Shortcut will now be available for use.
To invoke the Access Decompile shortcut, right click on an Access Database in Windows Explorer and select "Send To --> Access Decompile". Be sure to hold the shift key down to bypass any startup code in the database.