Uniqueness of auto generated primary keys

jjh

Registered User.
Local time
Yesterday, 21:20
Joined
Jun 7, 2006
Messages
32
I am developing a DB that is composed of approximately 50 tables. The primary key in every table is automatically generated byAccess. I understand that the primary key for each record in the table has to be unique. My question is: Is the primary key uniqueness applicable across the entire DB?

For example, table A has a auto gen key #25 in it. Therefore, no key in table A can be #25. Now I make an entry in table B (A:B, is 1:many). Can the primary key in table B be #25? OR, once #25 is used and continues to exist, it cannot be used in *any* table?

I have made several small examples and the keys across all the tables are unique. I don't know if this is guranteed across all the db tables, or just in my particular case?
Thanks
John
 
Key is unique only for the table it belongs to.

Each tables should have their own keys.

For 1:M relationship you give the many side table their own key, and insert a key from the 1 side table into a field. This will tell Access that this record relates to that record.

For 1:1 relationship, the child table does not have an autonumber at all. Instead, the key field is a number, related directly to the key field of the master table, so when a record is made, the key will be same in both master and child record.

HTH.
 

Users who are viewing this thread

Back
Top Bottom