Compact on Close (1 Viewer)

hfsitumo2001

Member
Local time
Yesterday, 23:00
Joined
Jan 17, 2021
Messages
365
In order to improve performance, is it good, if on Option on current database, we put " Compact on Close" to True?
 

Isaac

Lifelong Learner
Local time
Yesterday, 23:00
Joined
Mar 14, 2017
Messages
8,774
Given that you split your database, and each user's front end only has non-data objects (forms, reports, queries), I would recommend not checking this option.
 

hfsitumo2001

Member
Local time
Yesterday, 23:00
Joined
Jan 17, 2021
Messages
365
Given that you split your database, and each user's front end only has non-data objects (forms, reports, queries), I would recommend not checking this option.
Thank you Isaac.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:00
Joined
Jul 9, 2003
Messages
16,271
There have been reports of compact on close causing problems with your database. However I have always had it checked and allow my databases to compact on close, and I've never had a problem.
 

isladogs

MVP / VIP
Local time
Today, 07:00
Joined
Jan 14, 2017
Messages
18,209
In certain circumstances, compact on close can cause corruption.
Its far less common now than used to be the case 20+ years ago, but I wouldn't risk it either.
It will just slow down closing your FE database for little benefit.
As Isaac said there should be little need to compact the FE in a split database as it shouldn't get 'bloated'
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 07:00
Joined
Jul 9, 2003
Messages
16,271
As Isaac said there should be little need to compact the FE in a split database as it shouldn't get 'bloated'

From my point of view as a developer, I find it best to have compact on Close switched on because as you develop the database it does get bloated as you add and delete things.

I would agree that if you release it to your customer, then it's probably best to have it switched off.

The best way to tackle the possibility of corruption whilst developing is to make regular backups, because at some stage you are likely to get some sort of corruption...
 

isladogs

MVP / VIP
Local time
Today, 07:00
Joined
Jan 14, 2017
Messages
18,209
Yes I see your point, but I split my databases early on during the development cycle and prefer to have control over when compacting is done.
If I were to implement compact on close, I would also implement creating an automatic backup before closing
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 02:00
Joined
Feb 19, 2002
Messages
43,223
I hard code my network ID (and the one I use if I develop at home) in my apps apps. If it is "me", the app always asks if it should back up on close. I was using the last update date in the MSysObjects table to determine if I changed anything but this date is not reliable so I prompt or just let it always back up. For some apps, I even export all objects to text. When I'm connected to a network, the backup goes to two places. One on my c: drive and the other on a network drive. You can't ever have too many backups. I only have to remember to shut down the app every hour or so and the backup happens automatically. I mostly develop on a local drive so compacting isn't an issue. If you develop on a network drive, I would NEVER set the compact on close option to yes. In fact, I don't compact even manually when the .accdb is on a network drive. I copy it local, compact it, and put it back.
 

Users who are viewing this thread

Top Bottom