Hi Brian
When you perform a Compact/Repair, one of the things Access does is rebuild
the indexes. If an error has occurred (e.g. if there is a duplicate in the
field that is supposed to be the primary key index), Access cannot restore
the index, so it deletes it (not the field, just the index.)
If there was a relationship that depended on this index (such as
relationship to a foreign key with enforced referential integrity), Access
can no longer enfoce the relationship without the key index, so it also
deletes the relationship.
Normally this is rare, though I also struck it yesterday on An Access 2000
machine running on Windows 2000. I don't know if the Win2000 bit is
significant, but Win2000 and Win2003 currently use a different version of
msjet40.dll than what Windows Xp does.
If this is happening regularly for you and the data is coming over a
network, it might suggest that one of your machines has a flakey network
card/connection, so the writes are not always completed and the index is
being corrupted.
IME, Access is very stable when the database objects are not being altered
(e.g. in an MDE), but does not cope well at all with unstable network
connections.
--
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.
"BrianDP" <bdp222@gmail.com> wrote in message
news:1141241841.696803.248960@t39g2000cwt.googlegr oups.com...[color=blue]
> This is a strange one--
>
> I have an Access 2K database with a split front end/back end. There
> are two tables in the back end - RFile and RLine. There is a one to
> many relationship from Rfile.Rnumber to Rline.Rnumber. Originally I
> went in with the Relationships window, drew the line, and clicked the
> cascading updates and deletes. Everything was fine, for a couple of
> years.
>
> All of the sudden however, this relationship seems to delete itself.
> It's quite unlikely that any user goes in and deletes the relationship.
> In the last 3 months It has deleted itself 4 or 5 times. I go into
> the back end, look at the child table (Rline) and I'll find 2 or 3 sets
> of orphaned records where the parent record in Rfile was changed, and
> the children in Rline weren't changed along with the parent thus
> creating orphaned children. Of course, when I go to re-create the
> relationship, it won't let me because of the orphaned records, so I
> have to go and create the parent records again for these records, or
> just delete them.
>
> Help!
>
> 1) How could this relationship get deleted without someone actually
> doing it.
> and
> 2) I wrote a routine that automatically adds the records back in to
> the parent table, but I am at a loss for the query that creates the one
> to many relationship between the tables in the back end. If I had that
> code, to create a one-to-many relationship in the back end, at least I
> could have one of the users go in, click a button, and fix the database
> when I'm not here.
>
> -BrianDP[/color]