Compacting and repairing a different database using code

Phonik

Registered User.
Local time
Today, 16:13
Joined
Sep 22, 2006
Messages
111
Hello

I am aware that there are a lot of existing threads relating to compacting and repairing but I cant seem to find what I am looking for.
Basically, I developed a complaints database for my employers and it is used by around 45 people at any one time. The database was one of firt I built so it is not the best and is serious bloatware. Our server management team gave me an ear bashing the other day because the BE was 145MB. I did a compact and repair which took it to 45MB. The problem is that I need to do this daily but it involves kicking everyone out of their linked FE so the BE can be compacted/repaired. As an interim measure before I rebuild the whole thing I am going to schedule a database to open that will compact and repair the Complaints Database BE. Can anyone tell me the code to use to compact another database other than the one I am using. I have been looking at the code in other posts but I cant get it to work. The code I was looking at is the DBEngine.CompactDatabase... but I dont understand what comes after this and why??

Thanks people. :-)
 
Everybody has to be out of the db to compact anyway, so scheduling a compact for say 4.a.m. should be OK? Can't see why 145MB should be an issue, once it gets to 1.5GB, then would be a good time to sort it. Schedule it via a macro shortcut with Windows scheduler. DoCmd.RunCommand acCmdCompactDatabase

Chris B
 

Users who are viewing this thread

Back
Top Bottom