Compressing/Repairing Programmatically

  • Thread starter Thread starter Chaplain Doug
  • Start date Start date
C

Chaplain Doug

How would I initiate a database compress/repair from VBA
code? I know that this might be like a cat eating its own
tail, but I thought I would ask.
 
Hi!
How would I initiate a database compress/repair from VBA
code? I know that this might be like a cat eating its own
tail, but I thought I would ask.As far as I know there's no way to
compress and repair a DB from within...

You could try to put this command in a second *.mdb and tricks around with a
second Access-instance using "CloseCurrentDb" and "OpenCurrentDb". But there
is a good chance that this will not work...

Maybe you could code a compiled EXE-Application which you call from inside,
which kills your Access-instance, does the comression and repairing and
opens it again.

Anyway this is very ugly and not very satisfying...

If you find out a good way - please post it here!

HTH, Gottfried
 
You can't compact/repair the database that is currently open. But you can do
it from another database.

Send an email to me (remove this is not real from my return address) and
I'll email an example database to you that I use via Windows Scheduler to
compact a database.
 
Back
Top