473,395 Members | 1,937 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,395 software developers and data experts.

Records getting lost

I have a table in which a number of records get lost, most likely after
compacting the database.

The relevant table structure is as:

Table Tasks with a primary key TaskID (Autonumber)
Table Enquiries with primary key EnquiryID and foreign key TaskID (long
integer)

A relationship between the tables (on TaskID) includes cascading
deletes.

Not all enquiries relate to a task and so some records in the Enquiries
table have a null value for TaskID.

Records have on two occasions disappeared from the Enquiries table
(possibly, but not certainly after compacting). The missing records
appear to be those with a null value in TaskID.

Is this what one should expect after compacting?

I expect someone will advise me to redesign the table structure.

Jim

Nov 14 '05 #1
3 1657
No, you should certainly not expect to lose these records when you compact
the database.

Null foreign keys are an important part of database theory and practice.
Where they are intended (clearly your case), they do not represent any
problem with the data structure.

If the records are being lost on compact, it is more likely due to a
corruption of the database. For suggestions on how to avoid that, see:
Preventing Corruption
at:
http://allenbrowne.com/ser-25.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Jim Devenish" <in***************@foobox.com> wrote in message
news:11*********************@g49g2000cwa.googlegro ups.com...
I have a table in which a number of records get lost, most likely after
compacting the database.

The relevant table structure is as:

Table Tasks with a primary key TaskID (Autonumber)
Table Enquiries with primary key EnquiryID and foreign key TaskID (long
integer)

A relationship between the tables (on TaskID) includes cascading
deletes.

Not all enquiries relate to a task and so some records in the Enquiries
table have a null value for TaskID.

Records have on two occasions disappeared from the Enquiries table
(possibly, but not certainly after compacting). The missing records
appear to be those with a null value in TaskID.

Is this what one should expect after compacting?

I expect someone will advise me to redesign the table structure.

Jim

Nov 14 '05 #2
Allen

Thanks for helpful response. I am pleased that the data structure is OK
- I
thought that it should be.

It is possible this occurred after a corruption - not absolutely sure.

Sadly the back end does get corrupted once or twice a week. The most
likely
cause it the network. I am in the process of learning enough about SQL
Server to upgrade the back end but am not there yet.

I was interested in the statement in your link:

"If Access crashes, do not allow it to compact and reopen. Delete the
ldb file.
Create a copy of the crashed database. Then reopen, and compact/repair.
If it
did corrupt, it may be possible to rescue some objects from the
corrupted
database provided it has not been compacted. The undocumented commands
SaveAsText and LoadFromText are useful in this context."

How do I use SaveAsText and LoadFromText with a corrupted copy of the
database?

Jim

*** Sent via Developersdex http://www.developersdex.com ***
Nov 14 '05 #3
These commands work in VBA (so in the Immediate window).

If the database is corrupted to the place where it cannot be opened, they
won't work. Sometimes a particular form or report will not work with
SaveAsText even though it appears to be okay, and that is an indication that
the object has corrupted.

The syntax of the command is self-explanatory. For example, to export a form
named "Form1" as a text file:
SaveAsText acForm, "Form1", "C:\Form1.txt"

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Devonish" <no*****@nowhere.com> wrote in message
news:7Q***************@news.uswest.net...

How do I use SaveAsText and LoadFromText with a corrupted copy of the
database?

Nov 14 '05 #4

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

Similar topics

2
by: ndunwoodie | last post by:
I have table with 5 records each with 5 fields. I would like to have these records appear simultaneously on a form (i was thinking of some kind of bound control - not a listbox). I then plan to put...
35
by: deko | last post by:
Do I get more scalability if I split my database? The way I calculate things now, I'll be lucky to get 100,000 records in my Access 2003 mdb. Here some math: Max mdb/mde size = 2000 x 1024 =...
1
by: KC | last post by:
Hello, I am using Access 2002. WinXP, Template from MS called Orders Mgmt DB. I have tweaked this DB to work for our small co. It has worked pretty well up until I made the mistake of deleting...
29
by: lec | last post by:
Hi, I'm observing the following: If I commit the following records 1,2,3,4,5,6,7,8,9,10 to the database and the server hangs, I could lose records 5,6,7,8,9 but record 10 is there. How is this...
2
by: Maks Romih | last post by:
I'm not experienced in db2, but I have to write some rather complex processing with stored procedures for db2 on as400. The database consists of some twenty tables and is prepared in advance so...
3
by: BrianDP | last post by:
I have a database with a split front end/back end. There is a key table in the back end called Catalog, and it is sort of a central key table for all sorts of things. It's a list of all the jobs...
2
by: maxkumar | last post by:
Hi, I am running a ASP.NET 1.1 site on Win Server 2003 with IIS 6.0. The website has been running for about 1.5 years now. In the past, we used to have random cases of session variables getting...
5
by: BeeMarie | last post by:
Hi y'all, I've been struggling with this query for over 2 weeks and have tried so many ways to do it I've lost count. I have a student DB. Current student's records can be queried by the...
6
by: BEETHOVEN | last post by:
I have an option group called Issue_Type on my main form F1_Member_Demographics_Main. When I select one of the 3 options on the main form from the option group Issue_Type I want to limit the sub...
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: 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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
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.