Table relationship

dr223

Registered User.
Local time
Today, 14:14
Joined
Nov 15, 2007
Messages
219
I have two tables which I have created a relationship from (payer_det and stud_details).

However, when I am in the Edit Relationship and trying to Enforce Referential intergrity the following error is prompted

"Data in the table 'payer_det' violates the referential intergrity rules"

What can i do to sort this out?

The numhus field is in both the stud_details and payer_det, and forms the relationship. Relationship should be one- to- many. Also note I set the numhus field as the Primary key on the stud_details.

Thanks
 
The message is telling you that there are records in the payer_det table that have a value in numhus that does not match an existing value in stud_details. these are known as orphans. You may as well delete them since there is no way to figure out which stud_details they belonged to. Once you get rid of the orphans, Jet will allow you to create the relationship and enforce RI. You might consider setting CascadeDelete to true if this is a hierarchial relationshp such that if you delete a stud_details record, you want related payer_det records to also be deleted.
 
Thanks well spotted!!!!
 

Users who are viewing this thread

Back
Top Bottom