Compacting Access 97 databases using code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I want to be able to compact a database by calling a function after the
tables have been updated.

I would use the normal method but the tables are updated by a schedule and I
want the database to get compacted after this happens (about 3am every day
when Im not at work).

Does anyone know any code to help make this possible please?

Thanks in advance for your help.

Maver1ck666
 
I have but it returned an argument not optional error. Unless I have made a
schoolboy error somewhere?!?!

Now I understand this could be difficult as the database will still be open
when it tries to compact so would it be easier to have the code in a batch
file which is run by a scheduler after the database has closed?
 
Thanks for your quick reply.

This is where I become a noob im afraid. What code would I need to put in
the batch file please?

Kind regards,
Maver1ck666
 
Also, something I forgot to mention is I dont want to create a copy of the
compacted database if that makes sence?!? I just want the original file
compacted.
 
Maver1ck666 said:
Also, something I forgot to mention is I dont want to create a copy of the
compacted database if that makes sence?!? I just want the original file
compacted.

Compacting ALWAYS creates a new file. The menu action from within the GUI just
hides that from you. You just need to delete the original and then rename the
new file (which is what the menu action does).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top