View Full Version : On Timer Question


ipr1
08-08-2003, 12:13 PM
I want to compact a series of databases. Currently, I use a combo box and set it to run a macro to open and compress each database (run app command with a path as follows:

"c:\programs\msoffice\msaccess.exe" "c:\documents\dbname.mdb"/compact

Currently, I have to individually select each databse in the combo box, then click the command box, etc. and, if this is the best I can do, so be it.

However, I am playing around with the concept of tryiing to create something that will run a macro to compact the first database, then, once the first one is finished compacting to compact the second one etc. etc.

Am I nutso or is there a possibility that I can do something like this. Thanks in advance for any answers I receive.

Rich
08-08-2003, 12:54 PM
Isn't the compact on close a viable option?

ipr1
08-09-2003, 07:13 AM
Hi Rich - Yes, it is an option and I may be left with it but I really was interested in automating the entire process.

Thanks for your speedy help. I appreciate it.

namliam
08-11-2003, 05:15 AM
You can do a loop.

The compact creates a temporary DB in your compacting directory (DB1 i think), check on the excistance of that file or even the ldb if that excists during compact.

do while dir("C:\Temp\db1.mdb") <> ""
loop

then compact the next file

Regards

The Mailman

gkaste
08-13-2003, 03:33 PM
After you compress one database, in that macro, have it run another macro to compress the second database, then in that macro run a macro to compress the third, and so on.

WayneRyan
09-06-2003, 03:33 PM
Bob,

Why not put together a .BAT file or a VBScript and let the
Windows Scheduler run it?

Wayne

ipr1
09-09-2003, 09:51 AM
Thanks for your suggestion Wayne.

Any chance you could provide an example of the Bat file? (If I am right, I would have to have a Bat file for each database I wanted to compact; if I put all databases in one Bat file, we would still have the timer issue to resolve.