Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Repair and Compact

Status
Not open for further replies.

tboerner

Programmer
Oct 19, 2001
23
US
I want to Repair and Compact my Access database programmatically.

Anybody got the code handy?
 
I'm not advocating this, but I have used Sendkey for the alt-shortcut menu approach. No need to tell me it's lame, but it's a fallback if you don't get the answer you really need. :-V "Outside of a dog, a book is probably man's best friend; and inside of a dog, it's too dark to read" - G. Marx
 
A point of clarification:

I'd like to do this with Access 2000. I figured it out with Access 97.

dbEngine.compactdatabase Oldfile, Newfile

Does anyone know how to do this in Access 2000?
 
gives highly informative context on the issue.

Their second item relates to shelling a command, a la the following(which is on one line, in case it looks split)...
C:\program files\Microsoft Office\msaccess.exe" foo.mdb /compact

However I saw no mention there of Pope Bill's own retort, which is a standalone .EXE. ...

Sorry - the link contains semicolons so you may not be able to click it directly - can anyone get this fixed for Tek-Tips? (I'd think this came up a lot here, since K.B. articles are so vital here.):-0 "Outside of a dog, a book is probably man's best friend; and inside of a dog, it's too dark to read" - G. Marx
 
In Access 2000 there is an option (go to Tools, then Options) and on the General tab there is a checkbox for "Compact on Close". The help index states that "compacting does not occur if you close a multiuser (shared) database while another user has it open".
 
> "Compact on Close"

That is included in the article I referred to. AAR I wouldn't exactly pooh-pooh it, because that article is Michael Kaplan's (trigeminal is his website), making it fairly definitive :)

"Outside of a dog, a book is probably man's best friend; and inside of a dog, it's too dark to read" - G. Marx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top