Compact and Repair DB

bstice

Registered User.
Local time
Today, 11:24
Joined
Jul 16, 2008
Messages
55
I have a DB that only I use. Its gets big in terms of size very quickly. I would like to build some code that will allow me to run the "Compact and Repair" toolbar option as needed. I use Access 2003. What should this code look like? Thanks in advance.

Brennan
 
DBEngine.CompactDatabase . . . intellisense will give you the rest, but why not just do tools>database utilities>compact and repair?
 
Thanks Alisa for the quick reply. I usually use the toolbar command but I wanted to see if I could automate that with backup, cleanup etc.

I typed in the code you suggested, but I am not sure what else to add. The name of my Db is Backend.

I get an Arguement not Optional error when I run just DbEngine.Compactdatabase in the code. Thanks for your help.

Brennan
 
I think the arguments are the source path (the path of the file you are compacting) and the destination path (the path of what you want to save the compacted version as). Are you compacting the BE from the FE?
 

Users who are viewing this thread

Back
Top Bottom