Composite Keys

  • Thread starter Thread starter Mindy Chicken
  • Start date Start date
M

Mindy Chicken

Guest
I have recently started a new project, on one of my tables i have a composite key for my primary key. However when i create a relationship using one of the fields in the primary key i can't "enforce referential integrity". Every time i try i get the message "No unique index found for the referenced field of the primary field"

can any one help

Mindy
 
A composite key needs two fields to get a unique key. Therefore you will need to use both the keys that make up the composite key in your relationship.
 
Mindy Chicken said:
I have recently started a new project, on one of my tables i have a composite key for my primary key. However when i create a relationship using one of the fields in the primary key i can't "enforce referential integrity". Every time i try i get the message "No unique index found for the referenced field of the primary field"

can any one help

Mindy

I do NOT recommend composite keys. They tend to cause more problems then they are worth, including the one you are encountering. I recommend using an autonumber as your primary key for all tables. If you want to enforce uniqueness on a combination of fields you can do that using a multi-field unique index.
 

Users who are viewing this thread

Back
Top Bottom