View Single Post
  #17  
Old November 3rd, 2008, 12:21 AM posted to microsoft.public.access.tablesdbdesign
David W. Fenton
external usenet poster
 
Posts: 3,373
Default Using Autonumber as PK, cascade update doesn't work?

=?Utf-8?B?SG93YXJkIE1haWRtYW4=?=
wrote in
:

"David W. Fenton" wrote:

"Rick Brandt" wrote in
:

Howard Maidman wrote:
I too am using AutoNo. as primary key and cannot even get this
to populate itself in a subtable of a one-to-many even though
I have successfully created an accepted ref integrety with
cascading updates etc!

Anybody got any ideas?

What do you mean by "populate itself"? Cascade update updates
*existing* children records when the key field of the parent is
updated.


Except with an Autonumber, the parent value can never change
(Autonumbers are, by definition, not editable), so there's reason
to ever use CASCADE UPDATE on a relationship where the parent
side is an Autonumber PK.


Take it you mean 'never' use autonumber as a primary key?


No, not at all. Autonumber is almost always the best candidate for
PK.

What I should have written was:

there's **NO** reason to
ever use CASCADE UPDATE on a relationship where the parent side
is an Autonumber PK.


In other words, my comment was about when you should not use CASCADE
UPDATE, and not about when you should (or should not) use Autonumber
PKs.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/