ACC1x: Relationships Between Attached Microsoft Access Tables

Last reviewed: April 2, 1997
Article ID: Q109322
The information in this article applies to:
  • Microsoft Access versions 1.0, 1.1

SUMMARY

Although relationships cannot be established between attached tables in Microsoft Access, referential integrity can be enforced if the attached tables reside in another Microsoft Access database, and if relationships have been established in that Microsoft Access database.

MORE INFORMATION

The following example demonstrates the use of referential integrity between attached Microsoft Access tables:

  1. Create a new database in Microsoft Access.

  2. From the File menu, choose Attach Table. Select Microsoft Access in the Data Source box, and then choose OK.

  3. In the File Name box, select the sample database NWIND.MDB, and then choose OK.

  4. Attach the Categories and Products tables, and then choose Close.

  5. Open the Categories table in Datasheet view.

  6. Try to delete any record in the table. You will receive the following error message:

          Can't delete or change record. Since related records exist in table
          'Products', referential integrity rules would be violated.
    

  7. Open the Products table in Datasheet view.

  8. Try to add a record whose Category ID does not exist in the Categories table. You will receive the following error message:

          Can't add or change record. Referential integrity rules require a
          related record in table 'Categories.'
    

Note that you cannot define relationships for the attached tables in the Edit Relationships dialog box; the relationship must be established by a join in a query. If you do create a query using the attached tables, make sure that any join lines join fields with the same data type.


Additional query words: relate attach
Keywords : kbusage RltOthr
Version : 1.0 1.1
Platform : WINDOWS
Hardware : X86
Issue type : kbinfo


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 2, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.