ForeignKeyConstraint

  • Thread starter Thread starter David A. Osborn
  • Start date Start date
D

David A. Osborn

I keep getting the following message when adding a new record to a database
that has two tables. On table is a parent to the other. I am adding a new
parent record that has child records and I get the following:

ForeignKeyConstraint drtblCDstblSongs requires the child key value(9) to
exist in the parent table. Do you want to correct the value? Is there a
way I can just turn this off since with my program the only way to add a
child is to add the parent at the same time.
 
David said:
I keep getting the following message when adding a new record to a database
that has two tables. On table is a parent to the other. I am adding a new
parent record that has child records and I get the following:

ForeignKeyConstraint drtblCDstblSongs requires the child key value(9) to
exist in the parent table. Do you want to correct the value? Is there a
way I can just turn this off since with my program the only way to add a
child is to add the parent at the same time.

You need to add the parent record, then get the value of the foreign
key. then add the child record with using that foreign key. Why do you
want to remove this if it is enforcing your rules?

Chris
 
Back
Top