Re: Restart Autonumber
From: James (dragonzfang_at_hotmail.com)
Date: 07/17/04
- Next message: Peter McCartney: "Re: Hyperlink in access 97"
- Previous message: Peter McCartney: "Hyperlink in access 97"
- Next in thread: Mike Preston: "Re: Restart Autonumber"
- Reply: Mike Preston: "Re: Restart Autonumber"
- Reply: Jeff Boyce: "Re: Restart Autonumber"
- Reply: Bernard Peek: "Re: Restart Autonumber"
- Reply: John Baker: "Re: Restart Autonumber"
- Reply: Albert D. Kallal: "Re: Restart Autonumber"
- Reply: Alan Webb: "Re: Restart Autonumber"
- Messages sorted by: [ date ] [ thread ]
Date: 16 Jul 2004 21:31:03 -0700
I have been reading many posts by users that claim to have years of
experience with Access that promote the use of Autonumber generated
values as primary keys. Don't get me wrong; I use Autonumber values as
primary keys for standalone tables, such as those that really do not
have a primary key unless you use multiple key fields. But I keep
asking myself why anyone would create an architecture of two related
tables upon which the relationship is based on an Autonumber key
field. I'm currently working on one right now where I'm converting an
"Orders" table that uses Autonumber to generate Order numbers. This
Autogenerated value is then stored in the OrderDetails records. If the
scenario that you describe below occurs, guess what? You've just lost
your relationship between the two fields, because you cannot enter
your own values in an Autonumber field, and your OrderDetails table is
useless because the reference to the Orders table is gone. The
OrderDetails table will use an Autonumber key to basically serve as a
surrogate primary key, but I use a "natural" key that I control -
which in this case is my own "rolled" invoice #. The database I'm
converting is going to use my own "rolled" method, upon which a
function will return an incremented value from a table. With the
experience I've had with tables related based on Autonumbers, I will
never willingly design one to be as such.
"Jeff Boyce" <JeffBoyce_IF@msn.com-DISCARD_HYPHEN_TO_END> wrote in message news:<O8ykCGLXEHA.4020@TK2MSFTNGP09.phx.gbl>...
> Traci
>
> In addition to the cautions noted by Doug in his response, be aware that if
> your table's primary key (?your Autonumber) is used as a foreign key in
> one/more child tables, "restarting" your Autonumbers could hose the
> relationship between parent and child records.
- Next message: Peter McCartney: "Re: Hyperlink in access 97"
- Previous message: Peter McCartney: "Hyperlink in access 97"
- Next in thread: Mike Preston: "Re: Restart Autonumber"
- Reply: Mike Preston: "Re: Restart Autonumber"
- Reply: Jeff Boyce: "Re: Restart Autonumber"
- Reply: Bernard Peek: "Re: Restart Autonumber"
- Reply: John Baker: "Re: Restart Autonumber"
- Reply: Albert D. Kallal: "Re: Restart Autonumber"
- Reply: Alan Webb: "Re: Restart Autonumber"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|