Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    Apr 2005
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cascading Relational Integrity (Access 2003)

    Can you define cascading relational integrity in access through the query SQL design view?

    I want to go from:
    Alter Table BookCreatorLink
    ADD Constraint CreatorLink Foreign Key (CreatorLink) REFERENCES tblCreator (CreatorID);

    To:
    Alter Table BookCreatorLink
    ADD Constraint CreatorLink Foreign Key (CreatorLink) REFERENCES tblCreator (CreatorID) On Update Cascade;

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Cascading Relational Integrity (Access 2003)

    This syntax doesn't seem to be supported in the query window or through VBA with DAO, but you can use it in VBA with ADO:
    <code>
    Sub Test()
    Dim strSQL As String
    strSQL = "ALTER TABLE BookCreatorLink ADD CONSTRAINT CreatorLink " & _
    "FOREIGN KEY (CreatorLink) REFERENCES tblCreator (CreatorID) " & _
    "ON UPDATE CASCADE"
    CurrentProject.Connection.Execute strSQL
    End Sub</code>

  3. #3
    Star Lounger
    Join Date
    Apr 2005
    Posts
    61
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Cascading Relational Integrity (Access 2003)

    Thanks Hans.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •