Ref: Access "Compact and Repair" programatically
HI Guys, I'm looking for a way to run a batch script via scheduled task to compact and or repair a "Jet" .mdb file / database.
Environment
Win 7 32 bit
Jet 4.x format
application.exe Original code language unknown
I do have the Jet Engine installed - but lets pretend it's not as a scenario request
Automation is the end game here.
I've read the afore mentioned link "Access "Compact and Repair" programatically"
I'm really not a coder - so I spend about 2-3 hours trying to make all of that work, I failed miserably. : (
My request - if you can help, please . I'll need full "copy and past code" - my fingers suffer from Dyslexiconica ; ) I just can't code at this level.
I can make a simple batch file run successfully. I don't care if it is VBA or straight command line- but you'll have to instruct me on how to make it work.
Thanks for any and all help.
Very best regards, Vincent
Here is a jazzed up version of the compact on close, which displays messages for common problems; for example, for when the source file does not exist; when the source file has an invalid filename extension; and when the destination file exists (it mustn't).
Here is another Compact/Repair function below, but not advisable to do arbitrarily on every close - just replace/remove my on error code with your own
Call the function as such: