473,803 Members | 2,913 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Compact and Repair

Hello

The more I use an application ( an mdb) created using MSAccess I notice
that the Byte size of the application keeps on increasing. Once in a while I
do a Compact and Repair Database (under Tools in MSAccess) on the
application and the size then returns to normal.

What is causing the mdb to keep on increasing in size?

Is it a good idea to do a Compact and Repair Database every time the
application is closed so to keep the size of the mdb to a minimum?

If Yes what is the best way to do a Compact and Repair Database using code?

Thanks

G Gerard
Oct 27 '06 #1
3 2183
Sounds like you're creating temporary objects in your database.
That'll make it grow. You can set it to Compact and Repair on close,
which should keep it small. If you're creating temporary objects , you
might want to look at Tony Toews' site

http://www.granite.ab.ca/access/bloatfe.htm

Oct 27 '06 #2

"G Gerard" wrote
What is causing the mdb to keep on increasing in size?
Access does not return to the system the disk storage of objects that have
been deleted or replaced until you do Compact and Repair.
Is it a good idea to do a Compact and Repair Database
every time the application is closed so to keep the size
of the mdb to a minimum?

It's not necessary, generally, to compact every time you open your DB. It is
a good idea to split the DB into application (front-end: queries, forms,
reports, macros, and modules) and data (back-end: tables, relationships, and
data).

When you do, and can tell us which is growing, then someone may be able to
suggest ways in which you might be able to determine the cause and possibly
avoid some of the bloating. And, which you will need to Compact and Repair
most frequently.

Larry Linson
Microsoft Access MVP
Oct 30 '06 #3
"G Gerard" <gg*****@nbnet. nb.cawrote in
news:tt******** ***********@urs a-nb00s0.nbnet.nb .ca:
Is it a good idea to do a Compact and Repair Database every time
the application is closed so to keep the size of the mdb to a
minimum?
Access 2000 and later provides the "Compact on close" option.

I would recommend that it NEVER BE USED.

First off, if your app is properly structured, you're opening only
the front end. Front ends may bloat a bit, but since they have no
data in them, the bloat is finite, and so there's no compelling
reason to ever compact a front end (except to update the table stats
that are cached in the table links; that is, if you add 100K records
to a 10-record table in the back end, it would be a good idea to
compact the front end to update its metadata about that back-end
table; this metadata is used in optimizing queries and for other
purposes, such as helping the Rushmore data retrieval technology
decide how to retrieve data).

And COMPACT ON CLOSE is downright *dangerous* when opening a back
end because sometimes a compact to a damaged MDB will lose data that
is still accessible before the compact.

So, I would say:

Always keep COMPACT ON CLOSE turned off.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Oct 30 '06 #4

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

Similar topics

6
5579
by: KEVIN97810 | last post by:
Hello to all, Assume my mdb name is Cust.MDB. I want to compact & repair the same Cust.MDB when the user exit the program. Is there a way you can do it in code behind the EXIT button. I am dumping data from SQL to temp table and also delete from these tables in Cust.MDB. This would cause the MDB to get big. So I just want some code to compact and repair as user Exit from the access database. thanks a bunch.
3
5576
by: Paolo | last post by:
Hi, I am trying to compact and repair my database, however every time I try it comes up a message saying: Table: "TempMSysAccessObject already exists", whenever I try to look for this table I cannot find it anywhere... Any clues... Already went into the help file and nothing... Also try to copy my database and the same message comes up
4
2082
by: Ken Winters | last post by:
Whenever I run the Repair/Compact on my database, the security settings on the file change. A 3rd party application can only access the database over the network when the username "Everyone" is added to the "Group or user names" with access to the file. But each time the Repair/Compact utility is run, it removes "Everyone" from the list. This is under Win2000. Can anyone offer some advise or suggestions? Thanks
4
2085
by: Wayne | last post by:
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.
6
3085
by: GaryDave | last post by:
My school registration database has not been quite right after a recent compact and repair (done while I was away). Though most of the many forms and subforms are working normally, one form in particular will no longer allow new entries into the subform - the recordset of the underlying query is no longer updatable. The subform in question enters the identity and other vital info for children whose parent's ID provides the FK, linking...
2
1873
by: ApexData | last post by:
Hello I have finally completed an application and am preparing to install it on a network of 10 users. The application will be split FE/BE. The application has its own login, which controls the users ability to either ViewOnly or FullRights. Using Access2K. 20MB Database. My questions pertain to CompactOnClose:
2
2783
by: Ron | last post by:
Hi All, Using WinXP pro/Access 2000. I have a database that's been used for about 5 months. Transferred lots of data from a dos based program, then the users have been using it for that 5 months. About 180000 records in one of the main files (maybe 25000 new since the dos conversion). Been having some speed issues crop up along the way (much faster to do same reports when I first transferred the data than now, with the new 25000...
9
3993
by: Ron | last post by:
New discovery. If I take a perfectly good database, and "compact/repair" on it with Access 2000 (seems to be at multiple sites--I've tried it with my system here, at another office on an entirely different network), it damages the file somehow. The user's machine that did the compact/repair can see the file fine. But any networked user can't get in. I can double click on a good database file from any user (over the network) and it...
3
2210
by: Bizmark | last post by:
Access2003, Windows XP Pro OEM user OS, Windows Sever 2000 server OS. Not-so-recently I inherited 3 Access DB's from another company merging with our own. Our own system works off of SQL server, but mainting these databases is critical to keeping the business running. 1 database in particular has been causing problems. Along the course we have had a few problems with random records corrupting (new and old) and Values within fields...
4
3176
by: zufie | last post by:
When I Repair/Compact my Access databse. I get icons/copies of a database named db1.mdb, db2.mdb, db3.mdb, etc... How else may I repair this database? Thanks!, Zuf
0
9566
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10555
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10300
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7607
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5503
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4277
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
2
3802
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2974
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.