9/4/2023 0 Comments Recompile switch![]() It's silly that Microsoft hasn't integrated this into Access, considering it is a necessity when developing VBA-heavy applications. I wrote a VBS script to automate the process of decompiling. Last of all, read Michael Kaplan's article on the subject to understand it better. And I generally decompile/recompile as the last step before releasing an app into production use. In the VBE, add the COMPILE button to your toolbar.Ĭompile often with that button on the toolbar, after every two or three lines of code.ĭecompile is not something you should use all the time, but during heavy-duty coding, I might do a decompile a couple of times a day. In VBE options, turn off COMPILE ON DEMAND īecause you want to not just decompile the VBA, you want to make sure that all the data pages where the compiled p-code was stored are completely discarded before you recompile. Open the VBE and on the Debug menu, choose COMPILE. If you don't do that, then you might as well go back to step 3 and try again, since if the startup code runs, your code will recompile before you are ready to do so.Ĭompact the decompiled database (and be sure you hold down the shift key so that it bypasses the startup code see #5). Open a new instance of Access and open the database you just decompiled, but BE SURE YOU BYPASS ALL STARTUP CODE (i.e., hold down the shift key). Using the shortcut created with Tim's instructions, open your database. Be sure to hold the shift key down to bypass any startup code in the Lentine's practical instructions are good, but he leaves out the actual steps required for a decompile to be worth doing: To invoke the Access Decompile shortcut, right click on an Access Database in Windows Explorer and select "Send To -> Access Decompile". The Access Decompile Shortcut will now be available for use. Open Windows Explorer and paste the following into the address bar:Ĭopy the shortcut you created into the SendTo Folder. "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" /decompile 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.įollow these steps to customize the Send To menu with an Access Decompile shortcutĬreate a shortcut to the Access executable.Īppend the /decompile flag in the Target for the shortcut. If this is something you want to do frequently, you can create an "Access Decompile" shortcut in your SendTo Menu. Once the database opens, you can compact and repair the database to ensure optimal performance.Īfter the compact and repair, you can recompile the VBA code by opening any module and using the Debug Compile command. ![]() If you have any startup code in your database you should hold down the shift key to bypass the startup code execution. I'd recommend making a backup of your database before running this command. Obviously, the paths will be different on your system. Path to the database you would like to decompileĪll 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.Path to the MS Access Executable (MSACESS.exe).Those remaining objects can be compiled in a seperate command.To Decompile an Access database you'll need to create a shortcut with the following elements: Note that some objects may remain uncompiled due to race conditions. EXAMPLE 3 'Page','Codeunit','Table','XMLport','Report','Query' | % | Receive-Job -WaitĬompiles all uncompiled Pages, Codeunits, Tables, XMLports, Reports and Queries in the MyApp database in parallel and wait until it is done. EXAMPLE 2 Compile-NAVApplicationObject MyApp -Filter 'Type=Codeunit' -RecompileĬompiles all codeunits in the MyApp database. Examples EXAMPLE 1 Compile-NAVApplicationObject MyAppĬompiles all uncompiled application objects in the MyApp database. Unless the Recompile switch is used only uncompiled objects are compiled. The Compile-NAVApplicationObject function compiles application objects in the specified database.Ī filter can be specified to select the application objects to be compiled. In this article Syntax Compile-NAVApplication Object Compiles Business Central application objects in a database.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |