Compacting a database

  • Thread starter Thread starter Rajesh Candamourty
  • Start date Start date
R

Rajesh Candamourty

Dear ALL,

I have an Access database split to front end and back end. Is it advisable
to compact the front end alone as the file grows?

Any advise highly appreciated.
Thank you.
Raj.
 
Since the data's in the backend, it's typically the backend that needs to be
compacted. However, there's nothing wrong with regular compaction of the
frontend.
 
followup question from a curious person (since I have the same situation).

From the front end, what command do I issue to compact the back end?

Bob.
 
If all connections from the frontend to the backend are closed (you can tell
by the fact that the ldb file doesn't exist), you can use:

DBEngine.CompactDatabase olddb, newdb

What I typically do is rename the backend from C:\Folder\Backend.mdb to
something like C:\Folder\Backend_20050606.bak, and then compact the renamed
backend to the "correct" backend name:

DBEngine.CompactDatabase "C:\Folder\Backend_20050606.bak",
"C:\Folder\Backend.mdb"
 
Back
Top