Foreign Key Constraint Message
-
Hi...Sorry to be a pest. Perhaps related to my earlier post, but I'm getting the following message when I preview the dataset in the IDE: ForeignKeyConstraint 'EmployeeComments' requires the child key values (115) to exist in the parent table. This doesn't make sense. The relationship seems easy enough. The primary key and foreign keys are the same as far as Interger (8), nulls not allowed. Any ideas. Thanks in advance, Mike
-
Hi...Sorry to be a pest. Perhaps related to my earlier post, but I'm getting the following message when I preview the dataset in the IDE: ForeignKeyConstraint 'EmployeeComments' requires the child key values (115) to exist in the parent table. This doesn't make sense. The relationship seems easy enough. The primary key and foreign keys are the same as far as Interger (8), nulls not allowed. Any ideas. Thanks in advance, Mike
Simple. You have two tables (Table1 and Table2). Table2 has records that relate to records in Table1. The only thing holding the relationship is the fact that the two tables share a common field: Table1: Table2: recID ID# of record recID ID# of record in table 1 Name Some name Info1 Some information related to table1 Address Some address Info2 Some information related to table1 Both tables share a recID field. But, Table2 can have multiple records with the the same recID from Table1, this is a 1-to-many relationship. One record in Table1 is related to Many records in Table2. The problem your running into is there is a recID in Table2 that doesn't exist in Table1. It's a record that doesn't have a relationship to any record in Table1. You can probably code a SELECT statement to find the 'orphaned' records in Table2 for you, but I don't know exactly how to do it.