UtterAccess.com
We have detected that you are using an unsupported web browser. We recommend you to upgrade your web browser to get the most from UtterAccess forums.
Why should and how can I upgrade?
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Decompile, Compact and Repair    
 
   
Vongalin
post May 15 2009, 06:59 AM
Post #1

UtterAccess Enthusiast
Posts: 51



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.
Go to the top of the page
 
+
Doug Steele
post May 15 2009, 07:16 AM
Post #2

UtterAccess VIP
Posts: 18,543
From: St. Catharines, 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
Go to the top of the page
 
+
mishej
post 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.
Orepeat as needed. On heavy development days every 30 minutes.
Go to the top of the page
 
+
pacala_ba
post May 16 2009, 06:35 AM
Post #4

UtterAccess Veteran
Posts: 443
From: Europe, SLOVAKIA, Bratislava



><
Go to the top of the page
 
+
strive4peace
post May 9 2010, 02:03 AM
Post #5

UtterAccess Leader
Posts: 20,347



Hi pacala_ba (what is your name?)
rilliant! Your instructions are so easy to follow -- like the formatting too < 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 <
Go to the top of the page
 
+
Scott McDaniel
post May 9 2010, 04:56 AM
Post #6

UtterAccess VIP
Posts: 569
From: North Augusta, SC



That's a neat tip - I wish I had a corrupt form I could try it on! Thanks Crystal (and John).
Go to the top of the page
 
+
strive4peace
post May 9 2010, 10:42 PM
Post #7

UtterAccess Leader
Posts: 20,347



you're welcome < ... and thank you, Scott <
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Search  ·  Go to Top  ·  Lo-Fi Version Time is now: 30th September 2014 - 04:54 PM