473,790 Members | 2,561 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

A97 compact database question?

MLH
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 anyone ever experienced a data-loss during such
a compact operation under A97? Surely, the access
developer team writes a temp file for creating the compact
file or does some sort of backup to disk first BEFORE
overwriting the currently loaded file. Thoughts?
Experience?
Nov 13 '05 #1
6 2283
In the heyday of A95 a compact often corrupted the database. I
developed the habit of closing the database, compacting to a separate
mdb file then compacting the separate mdb file back over the original.
I still haven't gone back to trusting the 'in place' method.

James A. Fortune

Nov 13 '05 #2
MS

"MLH" <CR**@NorthStat e.net> wrote in message
news:6s******** *************** *********@4ax.c om...
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 anyone ever experienced a data-loss during such
a compact operation under A97? Surely, the access
developer team writes a temp file for creating the compact
file or does some sort of backup to disk first BEFORE
overwriting the currently loaded file. Thoughts?
Experience?


Back up the db first - just in case!

I go to the trouble of saving the data (tables) in a seperate .mdb as well,
so even if the worst happens (twice), it's not going to be catastrophic.
Nov 13 '05 #3
MLH <CR**@NorthStat e.net> wrote in
news:6s******** *************** *********@4ax.c om:
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 anyone ever experienced a data-loss during such
a compact operation under A97? Surely, the access
developer team writes a temp file for creating the compact
file or does some sort of backup to disk first BEFORE
overwriting the currently loaded file. Thoughts?
Experience?


If you open Explorer and watch the folder while Access is
compacting, you'll see it writes to db1.mdb, then deletes the
original mdb and renames db1.mdb to the original name. If the
compact fails, however much of db1.mdb that had been written at the
time the compact failed will be left, as well as the original file,
which is unchanged (since all the writing was into db1.mdb).

However, here's a simple rule:

Never compact without a backup.

I break it all the time, though, and have never once lost a minute's
worth of work.

There's on scenario where this is really critical, and that's with
replicated data. A compact can succeed without Access noticing
anything wrong, but replicability can be lost. Of course, you can't
copy replicated files (that creates dead replicas if you aren't
careful), so the way to protect your data is to synchronize it with
another replica before you compact it.

--
David W. Fenton http://www.bway.net/~dfenton
dfenton at bway dot net http://www.bway.net/~dfassoc
Nov 13 '05 #4
Just to refresh my memory, I opened Access 97 (no database selected), used
Tools | Database Utilities | Compact Database. It first opened a Common
Dialog window to let me choose the database that I wanted to compact, and
when that was chosen, opened another Common Dialog window to let me choose
the database into which I wanted to compact (preset to db1.mdb).

I don't even remember any settings that would bypass the second Common
Dialog window.

However, if you choose Tools | Database Utilities | Compact Database with a
database open, it does as you describe.

So, you have your choice -- compact the current database and let it overlay
the original once it is compacted, or close the current database without
closing Access, compact, and select the database to compact from and the one
into which you want to compact.

Larry Linson
Microsoft Access MVP

"MLH" <CR**@NorthStat e.net> wrote in message
news:6s******** *************** *********@4ax.c om...
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 anyone ever experienced a data-loss during such
a compact operation under A97? Surely, the access
developer team writes a temp file for creating the compact
file or does some sort of backup to disk first BEFORE
overwriting the currently loaded file. Thoughts?
Experience?

Nov 13 '05 #5
MLH
Thx, David. Good suggestion on opening explorer during the
process. 'preciate it.
xxxxxxxxxxxxxxx xxxxxxxxxxxxxxx x

If you open Explorer and watch the folder while Access is
compacting, you'll see it writes to db1.mdb, then deletes the
original mdb and renames db1.mdb to the original name. If the
compact fails, however much of db1.mdb that had been written at the
time the compact failed will be left, as well as the original file,
which is unchanged (since all the writing was into db1.mdb).

However, here's a simple rule:

Never compact without a backup.

I break it all the time, though, and have never once lost a minute's
worth of work.

There's on scenario where this is really critical, and that's with
replicated data. A compact can succeed without Access noticing
anything wrong, but replicability can be lost. Of course, you can't
copy replicated files (that creates dead replicas if you aren't
careful), so the way to protect your data is to synchronize it with
another replica before you compact it.


Nov 13 '05 #6
MLH
Thx, Larry. How have you been. Its been a long time.
The second pattern of behavior (running compact
with an open database running) is what caught me
by surprise. I wasn't ready for it. All is well, just checking
behind myself.
Nov 13 '05 #7

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

Similar topics

13
5079
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 and is there a fix? Thanks for any help,
13
10422
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, since that's what's open, and the back-end grows. I now have to manually open and close the...
1
2294
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 the constants to use to get to the compact and repair database option on the tools menu?
3
2379
by: Trevor Hughes | last post by:
Hello All I have a database (Access 2000, running on Win 2000), which suffers from bloat over a period of time. In order to solve the problem I set the option to compact on exit. This however has caused a problem. The permissions of the mdb file which are set to Everyone-Full control, are reset when the database is compacted. The end result is the the users get a message saying Access cannot locate the database. I can run it with...
4
2084
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.
2
2469
by: Greg Strong | last post by:
Hello All, I've written code in a test database with test data. Everything seems to be working except compact database in VB code per http://www.mvps.org/access/general/gen0041.htm. The reason I say this is the auto number fields are NOT being reset to zero. I delete the data from tables with action delete queries, then call the compact DB code which is followed by importing data to tables and subsequent append queries to other tables....
6
2310
by: owengoodhew | last post by:
Hi, I am responsible for maintaining an MS Access 97 Database that reliably becomes corrupt following a compact......... About the Database: The database is made up of three linked databases, data, input and output. The files all share the same table structures. Recently the input database started growing in size and it became necessary to compact the databases more frequently. Following the compact of the
2
2892
by: gibsonsgman | last post by:
hello, i have a question about compactin/repairing a database at runtime. i have code that will do this, but when it runs i get the error "You can't compact the open database while running a macro or visual basic code" this is very confusing to me, because i got it to work on one database without the error, and i did the exact same thing on the second database and I get the error. no matter what I do I cannot seem to get
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...
0
9666
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9512
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
10413
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...
0
9986
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6769
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
5422
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...
0
5551
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4094
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
3707
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.