Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Compacting databases

Status
Not open for further replies.

Digsys

Technical User
Jun 27, 2002
170
AU
I have just setup a database and the file size is 26Mbyte. It does not seem to grow as I add entries to the tables, indictaing that there must be a lot of empty space. I then used "Compact and Repair" tool and the file size is now only 1.2Mbyte. Have I lost anything?. It is still ok to keep adding entries to the tables and can they continue to expand?. Can someone enlighten me on this?
 
Yes, your database is fine. Microsoft is notorious for not doing any "garbage collecting". Meaning when you remove an object from the database (form, query, table, text box, field in a table, report, field on a report - you get the idea) Access will get rid of it, but it won't recollect the space. It's like a book shelf. If the shelf is half full and you take a book out of the middle the row doesn't get any shorter because it just leaves an open space where the book was. You have to push the books together to close the gap. Compacting the DB is like pushing the books together.

Fortuneately Access gives us this ability.

As for adding entries, yes the DB is fine, use it. You won't see much gain in size with added entries because they take up so little space (unless you're embedding OLE objects, but that's a discussion for another time).

Just make sure to Compact/Repair the DB every now and then.

Hope this answers your questions... Kyle

[anakin] + [curse] = [vader2]
[anakin] + [amidala] = [lightsaber]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top