473,396 Members | 1,726 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Compacting Access DB destroys relationships

Corrupt data in an access database seems to occur far too often. What's worse is that compacting an access 2000 or later db with corrupt data can result in the destruction of relationships.

It appears that during a compact access will remove corrupt records. If those removed records create referential integrity problems access deletes the relationship leaving orphaned relational data and missing relationships. Users can then unknowingly go on using the data with missing relationships causing all sorts of problems.

In 97 and previous it seems that the compact would fail and not kill the relationship which is a much better outcome.

Anyone know of a way to prevent access from destroying relationships during a compact?
Mar 9 '07 #1
5 1921
ADezii
8,834 Expert 8TB
Corrupt data in an access database seems to occur far too often. What's worse is that compacting an access 2000 or later db with corrupt data can result in the destruction of relationships.

It appears that during a compact access will remove corrupt records. If those removed records create referential integrity problems access deletes the relationship leaving orphaned relational data and missing relationships. Users can then unknowingly go on using the data with missing relationships causing all sorts of problems.

In 97 and previous it seems that the compact would fail and not kill the relationship which is a much better outcome.

Anyone know of a way to prevent access from destroying relationships during a compact?
Prior to any Compact Operation, the Database in question should always be backed up.
Mar 10 '07 #2
NeoPa
32,556 Expert Mod 16PB
Corrupt data in an access database seems to occur far too often. What's worse is that compacting an access 2000 or later db with corrupt data can result in the destruction of relationships.

It appears that during a compact access will remove corrupt records. If those removed records create referential integrity problems access deletes the relationship leaving orphaned relational data and missing relationships. Users can then unknowingly go on using the data with missing relationships causing all sorts of problems.

In 97 and previous it seems that the compact would fail and not kill the relationship which is a much better outcome.

Anyone know of a way to prevent access from destroying relationships during a compact?
If you're getting corrupt data any more times than would be consistent with unusual events (such as power outages or muppets turning off a PC without shutting the apps down properly first) then you should probably be looking closely at your database design and/or application.
That and your locking options on the PCs that use it.
Mar 10 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
In the Advanced tab in options, make sure the Default Record Locking is set to "Edited Record".

Mary
Mar 10 '07 #4
The data files are not becoming corrupt any more often than power outages, dropped network connections, hard drive problems, etc occur. However these things happen more often than I'd like.

Record locking is set correctly. But even if just one field in one record becomes corrupt the access compact process can delete the record. If the missing recored violates referential integrity access autmatically nukes the relationships that are being violated.

My problem is that I have several apps that use access as the back end and users compact the data regularly to improve performance. The installation of those apps includes a shortcut that compacts their data file. Since the compact process destroys relationships and doesn't even pop up a warning users continue using their applications without a clue that anything is wrong causing even more damage.

I have since built an application that will link to the datafile. Compact it and then check for the compact errors system table. If it exists it warns users that their data is damaged and to contact me so I can repair it or to restore from a previous days backup.

Considering this problem didn't exist prior to Access 2000 I was just hoping there was some sort of setting that could be changed to prevent Access from causing more problems.
Mar 14 '07 #5
NeoPa
32,556 Expert Mod 16PB
I can't answer that question specifically, but there seems to be scope there to compact to a separate file first, then only copy the file over if there are no errors detected. This can also flag up the problem if you like, but at least it would reduce the danger you refer to drastically.
Mar 14 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Peter Verhelst | last post by:
Hello, Currently I am running an Access database on a windows WTS server, running Microsoft Windows 2000 server 5.00.2195 Service Pack 3. This database should be accessible for everybody in our...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
5
by: lappy | last post by:
Hello, I have written a small programme to compact an access 97 database. Dim je As New JRO.JetEngine ' Compacts database Data.Mdb to Data2.mdb. je.CompactDatabase...
3
by: Ken Davis via AccessMonster.com | last post by:
I get this error message when trying to compact and repair my database: (Could not find field "Description"). When I clicked on Help, the error message number comes up as (Error 3799) It's the...
7
by: Ruben Baumann | last post by:
Just wondered if anyone has had occasion to use, or does use, FileMaker, or Raining Data's Omnis, or Alpha5's software, and how they compare with Access? Ruben
3
isben22
by: isben22 | last post by:
I am running SP Portal 2 and MS Access 2003. Our SPP has a LIST of events that many departments contribute to. I want to use MS Access to develop custom itineraries based off this calendar of...
1
by: Slez via AccessMonster.com | last post by:
I do a routine compact and repair on a back end MS Access 2002 database. This time I had something peculiar occur. The compact started as normal, than the following error message popped up (I...
3
by: DSSMaster | last post by:
I am trying to use windows scheduler to compact a database. In the task run line I have the following: "C:\Program Files\Microsoft Office\OFFICE11 MSACCESS.EXE" _ "C:\Files\Access\Sacroc.mdb"...
10
by: Richard | last post by:
Hi folks, thanks for taking the time to read this (and hopefully point our where I'm going wrong). The scenario: I have a local Access2007 database which links in several read only mySql...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
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...
0
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,...

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.