Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2004
    Posts
    9

    Unanswered: Cascade delete on table that is not required?

    hello, I have parent table that contains all children FK. Each of these children are not required input from the user. The user will only fill out the information that is needed. Is it possible to create cascade delete on FK that may or may not exist? I have tried to create this in access 2000, but it requires there be a valid FK?

  2. #2
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Hi skurge2 and "Welcome to the Forum"

    If you have your Tables setup properly with the PrimaryKeys, next you go setup your Relationships. When you do that and set your Referrential Integrity you have the options to set CascadeUpdate / CascadeDelete at that time. If you didn't, then go to your Relationships and RightClick on the Relationships line and then click EditRelationships. It will show you at the bottom of the Relationships window just what type of relationship both tables have like.. One-To-One, One-To-Many, Intermediate.
    As to the other part of your question....
    Is it possible to create cascade delete on FK that may or may not exist?
    , how can you Delete something that doesn't even exist??? That feature when setup works on the Keys when data is eventually input into it.

    hope you enjoy the Forum,
    have a nice one,
    BUD

  3. #3
    Join Date
    Dec 2004
    Posts
    9
    What I mean is that there a parent table that holds child fk. The user may or may not fill out the information for each child. So I only store the keys of the children that have been filled out. When I delete the parent, I want want every child key in the table to cascade delete. So there can be upto 0 to N deletes for a given parent.

  4. #4
    Join Date
    Dec 2004
    Posts
    9
    Never mind i figured out the problem. Thanks.

  5. #5
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by skurge2
    What I mean is that there a parent table that holds child fk. The user may or may not fill out the information for each child. So I only store the keys of the children that have been filled out. When I delete the parent, I want want every child key in the table to cascade delete. So there can be upto 0 to N deletes for a given parent.
    Hi skurge2, glad to hear you got it to working. And I understood quite well your situation and that is exactly how the Referrential Integrity with the Table relationships works with the Cascade Update/Cascade Delete. When you delete the Parent all the other references related to it also go. Although for the sake of Historical Data, it's not always a good thing to Delete those records. Rather, archive them into a separate table to review at will, but at the same time disassociated with your Active Data.

    but nonetheless I am happy to hear your problem is now solved.
    BUD

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by skurge2
    Never mind i figured out the problem. Thanks.
    Ok ... So what did you do??? Enquiring minds want to know ...
    Back to Access ... ADO is not the way to go for speed ...

  7. #7
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by M Owen
    Ok ... So what did you do??? Enquiring minds want to know ...
    Good one M Owen, that I would like to know myself. Skurge2, what we do here is when we find a resolution to our problems, out of courtesy to others who may run across the same situation in the future, or have that same problem now, that we Post the resolution / answer to the problem. That way others too may also learn. But yes, I also am interested in how you resolved your particular situation.

    thanks and have a nice one,
    BUD

Posting Permissions

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