My Assistant
![]() ![]() |
|
|
May 15 2009, 06:59 AM
Post
#1
|
|
|
UtterAccess Member Posts: 47 |
Everyone has their own methods of doing a decompile, compact and repair - I'm no different. This is the CMD file that I use after a day of developing. I have tried various methods, but this is the one that works the best for me. I read that the compact/repair switch is combined into one and that one of them is carried over to 2007 for compatibility, but I get better results when I separate them.
First, add a macro to your database named 'devClose' and add 'Quit' to it. Next add this code to a CMD or a BAT file (edit paths and names as needed): CODE "C:\Program Files\Microsoft Office\Office12\MSACCESS.exe" /Decompile "C:\Projects\Project\Project_1_1_0.accdb" /x devClose ping -n 5 localhost >nul "C:\Program Files\Microsoft Office\Office12\MSACCESS.exe" /Repair "C:\Projects\Project\Project_1_1_0.accdb" ping -n 5 localhost >nul "C:\Program Files\Microsoft Office\Office12\MSACCESS.exe" /Compact "C:\Projects\Project\Project_1_1_0.accdb" ping -n 5 localhost >nul First it will open, decompile and close your database. Wait 5 seconds, repeat w/a repair, close and wait 5 seconds. Finally it will compact it, close and wait another 5 seconds. Works great for me, hope it does for you. As always, please make sure that you have a backup before you try this or anything else posted that you find. |
|
|
|
May 15 2009, 07:16 AM
Post
#2
|
|
|
UtterAccess VIP Posts: 17,644 From: Don Mills, ON (Canada) |
You might want to read what MichKa has at The real deal on the /Decompile switch , specifically part at the end (RISKS TO DECOMPILE: WHY YOU SHOULD NOT USE IT CONSTANTLY).
And I think it might be better to rename the database and compact it to a different database, rather than compacting "in place": at least that way, if the compact fails, you still have the original database. Danny Lesandrini has an interesting approach at Compact an Access Database with VBS Script |
|
|
|
May 15 2009, 07:20 AM
Post
#3
|
|
|
Retired Moderator Posts: 11,289 From: Milwaukee, WI |
I agree - the process or steps are probably very individualistic...
This is my routine w/2007. Like most folks I have a method that I always follow. I can't say it is the *way*; only that it (appears) to work for me. - Close all modules / forms / reports - Compile code - Save file - Compact / Repair and Close Run /decompile and immediately close (Alt-F4). Open file holding <Shift>. Compact / Repair. Alt-F11 to open VBA Editor. Debug, Compile from menu and close any open modules. File/Save. Run Compact / Repair. Optionally create .MDE/.ACCDE version. ------------------- FWIW... my latest project is A2007 and I've experienced more corruption issues than ever before. If I can identify a form or report as the problem then the undocumented Application.SaveAsText / .LoadFromText() procs work great. The /decompile switch is also valuable and has solved issues. I repeat as needed. On heavy development days every 30 minutes. |
|
|
|
May 16 2009, 06:35 AM
Post
#4
|
|
|
UtterAccess Veteran Posts: 443 From: Europe, SLOVAKIA, Bratislava |
QUOTE before Decompile VBE-TOOLS-OPTIONS-GENERAL-TAB----->> COMPILE ON DEMAND = <OFF> QUOTE Manually: Alt-F11 to open VBA Editor. Debug, Compile from menu and close any open modules. File/Save. ===================================================== Automation: docmd.RunCommand acCmdCompileAndSaveAllModules docmd.RunCommand acCmdExit Use someone instead macro with switch /x Macro_CompileAndSaveAllModulesAndExit ? QUOTE Application.SaveAsText / .LoadFromText() (MDB-TXT-MDB)
i had somewhere read, that some special features are NOT SUPPORTED.... |
|
|
|
May 9 2010, 02:03 AM
Post
#5
|
|
|
UtterAccess VIP Posts: 20,211 From: Colorado |
Hi pacala_ba (what is your name?)
brilliant! Your instructions are so easy to follow -- like the formatting too (IMG:style_emoticons/default/smile.gif) thank you ~~~~~~~~~~~~~~` since you bring up SaveAsText and LoadFromText... and corruption has been discussed here ... something interesting I learned from John Viescas was that the NameSpace tag [ NameMap = Begin 0x0acc0e550000000010122cb9c383d211978d00aa00...20079000000 End] in the text file generated by SaveAsText is where AutoCorrupt puts its information. Everything can be deleted between Begin and End to attempt recovery of a corrupt form. Haven't had to try it yet myself (IMG:style_emoticons/default/wink.gif) |
|
|
|
May 9 2010, 04:56 AM
Post
#6
|
|
|
UtterAccess VIP Posts: 569 From: North Augusta, SC |
QUOTE something interesting I learned from John Viescas was that the NameSpace tag [ NameMap = Begin 0x0acc0e550000000010122cb9c383d211978d00aa00...20079000000 End] in the text file generated by SaveAsText is where AutoCorrupt puts its information. Everything can be deleted between Begin and End to attempt recovery of a corrupt form. That's a neat tip - I wish I had a corrupt form I could try it on! Thanks Crystal (and John). |
|
|
|
May 9 2010, 10:42 PM
Post
#7
|
|
|
UtterAccess VIP Posts: 20,211 From: Colorado |
you're welcome (IMG:style_emoticons/default/wink.gif) ... and thank you, Scott (IMG:style_emoticons/default/smile.gif)
|
|
|
|
![]() ![]() |
|
Go to Top · Lo-Fi Version | Time is now: 25th May 2013 - 02:28 PM |