Compact database

M

Markus Weber

Hello!

I just want to compact the current database as done when I use the
menu point to compact and repair a database. How can I accomplish
this?

Currently I find mthods only to compact other databases, but not the
current one itself.

Thanks in advanve!
 
N

Nikos Yannacopoulos

Markus,

There's a very good reason for this! To compact a database, Access
actually closes it, compacts it into a new file, deletes the old file
and renames the new one the old one's name. Apparently you can't do all
that with code within the database itself - the last thing done will be
to close the original.
Some do it by forcing the execution of the menu item from code, but it
is not recommended, and it is practically not required either in the
sense that:
(a) if it is a single user database, or the front end of a multi-user
one, you can use Compact on Close which will do the job just fine,
without any programming, or any manual action required by the user;
(b) if it is the back end of a multi-user database, you don't do it from
within itself anyway, nor could you do it most of the time simply
because other users are logged in. In this case I would recommend a
scheduled job to do it automatically overnight, when no users are in.

HTH,
Nikos
 
M

Markus Weber

hi Nikos,

you are right, so now I use the option you told (Compact on Close).
Thanks!
 

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

Similar Threads


Top