"Allen Browne" <AllenBrowne@SeeSig.Invalid> wrote in message
news:3fee4dc6$0$1721$5a62ac22@freenews.iinet.net.a u...[color=blue]
> Yes, Pete. Even 1:1 relationships have a primary table and a related[/color]
table.[color=blue]
> The direction of the cascading delete is from the 1 to the many.[/color]
*****************
The above statement is very important . . if you really think that a delete
should work both ways then IMHO you data design is screwed . . if your
designers came up with such a structure I would certainly question their
reasoning . . and I was designing DBs in the 70s . . so normalising tables
etc, I do in my sleep . . grin . . . and JET is an excellent engine for
most applications when you know how to really design tables for it . .
usually the better the table design . . the easier the forms/code etc that
come s after it . .
as for 1:1 relationships . . there should be 1 ( ONE ) table that is the
master or primary entity. any other tables related to it are sub-sets of
data and need a very good reason to be seperated from the master. Security
is one good reason. Sensitive data can be stored seprately. Also data that
only occurs in reletively few records, but even this is not a strong reason
.. Or if some data is only rarely needed . and kept seperate for
performance reasons . . .
Ultimately anytime a 1:1 relationship occurs . . consider combining it and
demand a strong reason not to !!!
cheers paul g
ps . . my observations of questions in this newsgroup tell me that far too
many people are focused on clever code and not on underlying and less
glamourous table design . . if they thought out the application spec before
the built their systems they would avoid many of the silly ( read stupidly
unnessasry) problems that get posted here . .
********************
[color=blue]
> You could drag a 2nd copy of Table2 into the Relationships window, and try
> creating another relationship between Table2.ID and Table1.ID where Table2
> is the primary table? Never tried, but JET probably won't come at it. If[/color]
it[color=blue]
> did you may well have confused the life out of it, so you better do some
> serious testing. Amongst other things, you probably would not be able to[/color]
add[color=blue]
> new records to such a design, since the primary record would be required[/color]
in[color=blue]
> both tables before it could be created in either.
>
> --
> 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.
>
> "(Pete Cresswell)" <x@y.z> wrote in message
> news:0lhsuv8l3n8hiugs011ktr9t4aavtvp3dc@4ax.com...[color=green]
> > RE/[color=darkred]
> > >And your question is...?[/color]
> >
> > How to enforce referential integrity and cascading deletes in both[/color]
> directions[color=green]
> > when a 1:1 relatinship exists?
> >
> > i.e. Table1 ===== Table2
> >
> > Delete a rec from Table1, corresponding record in Table2 is deleted
> > automatically.
> >
> > Delete a rec from Table2, corresponding record in Table1 is deleted
> > automatically.
> >
> > Seems like either one can happen, but not both.
> > --
> > PeteCresswell[/color]
>
>[/color]