Compact and repair.

Sam_Bur

Registered User.
Local time
Today, 07:25
Joined
Dec 14, 2006
Messages
24
Hi,

Could anyone explain to me what compact and repair actually does? Made a backup copy of my database and did the c and r and reduced the size greatly! Has it lost data? Just would be good to understand how this works.

Thanks

Sam
 
There are actually a lot of little things it's doing, but the main space recovery is that Access still has all those records you deleted, all those tables you've created and deleted, all the forms, etc. The compact and repair goes through and says, "This is marked for deleting" and actually deletes it. If you've ever had a table open while a query deleted that table, you will go back to that table and see all the entry marked as #Deleted#. It is those that get actually cleaned up. Another piece that Compact & Repair does is reset your autonumber if it's a sequential autonumber.

As an example, think of when you delete a file out of Windows Explorer. If you don't hold shift down, the file goes to the trashcan. Then you empty the trashcan to actually remove the file. (That's not exactly what happens with emptying the trashcan -- the reality is that the file gets marked by NTFS as deleted and therefore the disk space occupied by that program can be overwritten. However, whatever you deleted is still there until it's overwritten. That's a whole other technical piece.)
 
cheers,

Thats great, Thank you very much!

Sam
 

Users who are viewing this thread

Back
Top Bottom