What exactly does the "Compact and Repair Database" do?

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

Guest

I am sorry for posting this question under forms but it seems that the people
who helped me out here knows their stuff!

What exactly does the "Compact and Repair Database" do when you select it
under Tools/Database Utilities? I know this might not be a really really
important thing but I always like to know what each function does. Thanks
for your help in advance!

Sincerely,

Leonard Peacock
 
First, it takes out the trash. Deleted items and records are still in the
file until you compact it. That is why the database gets so large. Even if
you haven't deleted anything, Access may have from temporary tables that it
uses. Next, it reindexes the indexed fields, so if you have a corrupted
index, this should fix it. I believe it also reorders the physical order of
records in the tables. Depending on your version of Access and/or whether or
not there are any records in a table, it will reset the next autonumber
value to 1 more than the highest value or to the seed value if the table is
empty. There are other repair functions that it does, but I don't know what
they all are.

It is a good idea to regularly do a Compact and Repair on your database to
keep it working properly. You have to have exclusive access to the file to
do this. Make sure all other users have closed the database if you have a
multi-user database. Also, don't forget to do the back-end file also if
you've split your database.
 
Thank you so much Mr. Morgan for your help! It makes sense now. :-)

Sincerely,

Leonard (Wayne) Peacock
 
We managed to perform the compact and repair from our VB code. Is there any
thing I need to now about the result of the C&R opertion? For example, I
belive that we need to decide whether to use the compacted database (if it is
OK), or fall back to the previous banckup if the result of the compact and
repair was not accepted like missing tables or corrupted records in some
tables or missing relation(s)!

How can I find out about that? Does Acces write the results anywhere? If som
Where is that? & How can I interpret it?

Thanks.
 
Back
Top