473,569 Members | 2,526 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compact On Close Question

Does "Compact On Close" do a "Compact and Repair" or just a compact.
Is a compact necessary (or at least a good idea) on a regular basis,
say weekly, for a database that has several hundred records per week
added to it?

TIA.

Nov 13 '05 #1
4 2068
Wayne wrote:
Does "Compact On Close" do a "Compact and Repair" or just a compact.
Is a compact necessary (or at least a good idea) on a regular basis,
say weekly, for a database that has several hundred records per week
added to it?


Compact and repair is in the same operation now unlike it was many years
ago so I would assume that it does a repair as well but don't worry, it
doesn't "repair" it like Access 2.0 used to do <g>.

Compacting has two effects that I can think off the top of my head:
1. It gets rid of deleted space in the database thereby (hopefully)
shrinking it.
2. It deletes the execution plan of saved queries so they'll get
recompiled the next time they're run.

Both are a good thing, the overhead of compiling an execution plan for a
query is small and you won't notice it without some sort of benchmark
and some very small fractions of seconds. As data changes, the original
execution plan of a query may not be the best one but Access will use it
if its been saved there.

I've not had to compact a database for a long time as I've only used SQL
Server back ends in recent years and the front ends are in StarTeam and
in constant development regularly requiring deletion and getting a whole
new version out of source control so I can't have any frame of reference
for regular compacting but think of it like washing the car, if it's
dirty, clean it. If it's been parked in the garage all week then washing
it won't harm it but it's a bit pointless at that time.

Oh, nearly forgot, there is a regular compact I do, the one in XP where
MS are sorry for the inconvenience and it compacts it for me.

--
1f u c4n r34d th1s u r34lly
n33d t0 g37 l41d

Nov 13 '05 #2
Thanks for the helpful info Trevor.

Nov 13 '05 #3
Trevor Best <no****@besty.o rg.uk> wrote in
news:42******** *************** @news.zen.co.uk :
Compact and repair is in the same operation now unlike it was many
years ago so I would assume that it does a repair as well but
don't worry, it doesn't "repair" it like Access 2.0 used to do
<g>.


If I'm remembering correctly, MichKa told us that with Jet 3.5 SP2,
every compact checked to see if a repair was necessary and then ran
it if it was necessary. It did *not* run it if there was nothing to
repair, as under certain circumstances, a repair could actually
*damage* a perfectly valid database.

"Repair" is obsolete. Don't use it.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #4
Trevor Best <no****@besty.o rg.uk> wrote in
news:42******** *************** @news.zen.co.uk :
Compacting has two effects that I can think off the top of my
head: 1. It gets rid of deleted space in the database thereby
(hopefully) shrinking it.
2. It deletes the execution plan of saved queries so they'll get
recompiled the next time they're run.


It also rewrites tables with a PK in PK order.

And it also cleans up the data pages of indexes, putting those in
order.

Both of these things can improve performance, especially with large
tables.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
5059
by: James Franklin | last post by:
Hi, I have a number of databases in A2K, written on different machines with different installations of Office. I have found that compacting a database while it is open regularly fails, seemingly at random. This is especially annoying as I usually set the Compact on Close setting in Tools/Options to true. Has anyone else experienced this...
13
10404
by: Larry L | last post by:
Access is noted for bloating a database when you add and delete records frequently. I have always had mine set to compact on close, and that works great. Now after everyone's advice I split my database, so the data is in a second (back-end) database with all the tables linked. However, now when I close the database, it compacts the front end,...
1
2277
by: ColinWard | last post by:
Hello everyone. happy new year. I am trying to code an exit button for my application so that it automatically compacts the database when the user exits the app. Is this necessary or does the "Compact on close" option work even when the database window is not displayed? Is it best to "roll my own" or not? My second question is what are...
1
2088
by: smitty mittlebaum | last post by:
I have a strange problem that has reared its ugly head in the last few weeks. I have the option "Compact on Close" (Tools, Options, General tab) enabled on my development machine. I did this because every time I worked on my app it just grew and grew. What started out as a 14Meg file kept growing into a monster of over 90 Megs! System...
1
4942
by: Mark | last post by:
Hi all, I have a Access 2002 FE/BE scenario where the BE is stored on a network drive. Due to the amount of importing/deleting, the database bloats quite a lot. UP until now, I have been booting the users out of the database and manually compacting it. What I am trying to do is automate the process so I don't have to worry about it. My VB...
1
4813
by: robert demo via AccessMonster.com | last post by:
In my startup routine, I have the following code: s = CLng(FileLen(filespec) / 1000000) If s > 5 Then 'FIRST, BACKUP THE FRONT END If BackupFrontEnd = False Then Exit Function End If
6
2265
by: MLH | last post by:
I just used Tools / Database Utilities / Compact Database in Access 97 for the first time. Unlike Access 2.0, it does not ask me to furnish a filename for it to compact into. It just launched headlong into a process that, after the fact, had the result of overwriting the 44-meg previous size file into an 8-meg file of the same name. Has...
29
2754
by: Neil | last post by:
I would like to compact on close only if the database size goes over a certain amount, rather than each time. Thus, I'd like to check the file size and then perform the compact through code as the mdb's closing. Is that possible? I suppose one option would be to set the Compact On Close option in the switchboard's On Close event, and then...
0
2825
by: ARC | last post by:
Hello all, Due to some users experiencing severe front end bloating (Normal compacted front end .accdr is 27MB's, FE can bloat to 80-90+Mb's in a day), I want to enable the "Compact on Close" option on the front end, and distribute in a runtime installation. I do have my share of update / append queries, and I've always suspected that...
0
7614
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8125
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7974
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5219
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3642
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2114
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1221
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.