Results 1 to 4 of 4
  1. #1
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591

    Referential Integrity

    I am trying to patch together some data that was entered into of copy of my database. I know I can link to it, but I want to consolidate all this into my home database so I can do a clean split later. I am more that halfway there, but I ran into something that puzzles me. There are three tables with autonumber primary keys. First I deleted all the relationships in the destination tables and the data, then did a Compact and Repair to reset the numbers. So far so good. I copied and pasted my data successfully. All the ID numbers remained the same. Again these tables are all related by these ID numbers. In the other database these tables are linked and have Referential Integrity enforced, including cascading deletes. Here are the three tables



    tblTransactions (Primary Key - Transaction_ID, Foriegn Key - Submission_ID)
    tblSubmissions (Primary Key - Submission_ID, Foriegn Key - Batch_ID)
    tblBatchID (Primary Key - Batch_ID)

    I think I've laid this out correctly.

    First I relinked tblTransactions to tblSubmissions successfully using Referential Integrity. My last task is to link tblBatchID to tblSubmissions and Access tells me it can't create this relationship and enforce Referential Integrity.

    I ran a query to see if there were any records in tblBatchID that had no related records tblSubmissions and there were none.

    I'm stuck. Any ideas?

    Paul

  2. #2
    jzwp11 is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Are there any records in the submission table where the Batch_ID field is null or where the Batch_ID field contains a value that is not in the batch table? I assume that the batch_ID primary key field and the corresponding foreign key field are of the same datatype, correct?

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,931
    Reread original post, removed comment.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    Paul H's Avatar
    Paul H is offline Expert
    Windows XP Access 2010 32bit
    Join Date
    Sep 2011
    Location
    Richmond, VA
    Posts
    591
    I'm going to mark this solved to take it off the table. This is a mute issue because we are going to purge our tables before we go live. There's very little gain here.

    Thanks anyway though.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. referential integrity
    By askjacq in forum Database Design
    Replies: 1
    Last Post: 10-14-2011, 03:23 PM
  2. Referential integrity rules
    By mhart in forum Database Design
    Replies: 2
    Last Post: 07-28-2011, 04:43 PM
  3. Referential Integrity
    By Desstro in forum Database Design
    Replies: 4
    Last Post: 06-13-2010, 01:29 PM
  4. Referential Integrity
    By U810190 in forum Access
    Replies: 1
    Last Post: 03-29-2010, 05:21 PM
  5. Referential Integrity
    By jbarrum in forum Access
    Replies: 5
    Last Post: 01-14-2010, 09:04 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums