Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Relationship settings

Status
Not open for further replies.

CliveW

Technical User
Aug 19, 2002
36
GB
I'm trying to set a relationship up between 3 tables.
The parent table (table1)
A child table(2)
and (table3)

The relationship between table1 and table2 links okay with the insert and delete and cascading in the update and delete.

The when I try to link table2 to table3
I get the following error message
"The columns in table 'Table2' do not match do not match an existing primary key or unique contraint."

I have had a look at both tables and the field I'm trying
to link to within the tables are both unique or primary keys.


It works fine this way but, its not the way the programmer wishes it to link.
In the relationship properties.
Primary Key Table Foriegn Key Table
Table3 Table2
field1 field1

Linking it this way when we goto update table2 the following message is shown.
"Insert conflict with foreign key constraint FK_TABLE2_TABLE3. Conflict occured in the database table3 column field1."






Thanks
Clive
 
there cannot be a relation between two primary keys in 2 tables.


a primary key in parent table should be foreign key in second table. i.e. it shouldn't be a primary key in table2.






Bye
miq
 
Thanks miq

I have sorted the programmer out now.


Clive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top