ACC2: Error When Trying to Enforce Referential IntegrityLast reviewed: May 28, 1997Article ID: Q113494 |
The information in this article applies to:
SYMPTOMSNovice: Requires knowledge of the user interface on single-user computers. When you create a relationship in the Relationships window by dragging a field from one table to another, you get the following error message when you select "Enforce Referential Integrity" and choose the Create button:
Can't create relationship to enforce referential integrity. The field(s) in the primary table must be the primary key or have a unique index. CAUSEYou must drag the joining field from the "one" side to the "many" side in order to enforce referential integrity." The field on the "one" side must also be the primary key field in that table, or have a unique index. If you are dragging the joining field from the "one" side to the "many" side and still get this error, another possible cause might be the way your indexes are set up.
RESOLUTIONTo set up your indexes correctly, open the "one-side" table in Design view and set a primary key, or create a unique index, for the field you want to use. Then, create the relationship between the tables. The following example uses the sample database NWIND.MDB to demonstrate a relationship with referential integrity enforced:
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
REFERENCESFor additional information about setting up relationships, search for "Relationships" using the Microsoft Access Help menu. Microsoft Access "User's Guide," version 2.0, Chapter 2, "Designing a Database (Determining the Relationships)" Microsoft Access "User's Guide," version 2.0, Chapter 7, "Table Basics" |
Keywords : kbusage TblOthr
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |