No unique index

T

Tony Wainwright

Hi guys
I have two tables that I have a one to one relationship, both have identical
primary keys. When I try to enforce referential integrity I get the
following error:
'No unique index found for the referenced field of the primary table.'

Can anyone tell me how to get rid of this. I have rmoved from the indexes
of both tables all fields except the Primary key and it still doesn't work.

Tony
 
G

Guest

Tony Wainwright said:
Hi guys
I have two tables that I have a one to one relationship, both have identical
primary keys. When I try to enforce referential integrity I get the
following error:
'No unique index found for the referenced field of the primary table.'

Can anyone tell me how to get rid of this. I have rmoved from the indexes
of both tables all fields except the Primary key and it still doesn't work.

The problem isn't too many indexes - it's one too few! Are you completely
sure that a) there is in fact a Primary Key on the joining field in the
"parent" table of the relationship and b) that you're joining on the right
fields? The error message suggests that either the primary key unique index
does not exist at all, or that you're not joining on the field which has the
index defined.

You may need to remove the Primary Key indicator in table design view,
Compact the database (to get rid of a possibly damaged index), and respecify
the Primary Key in each of the two tables.

John W. Vinson/MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top