Board index » delphi » can't delete a master record and its details records

can't delete a master record and its details records

dear sir,
i'm using delphi 3.00 with paradox tables and i can't delete a master
record and its details records, allthough there is a referential
integrity defined with cascade!!! update rule between the tables. i get
an error message - "master have details cant delete or edit record".
the problem accurs also when the tables are opened exclusive and there
isnt any locks on the records. i expect that by deleting the master
record all the details record will be deleted also.
is there a bug? or i'm doing some thing wrong?

nitsan
enfi...@actcom.co.il

 

Re:can't delete a master record and its details records


The "cascade updates" setting means what it says<g>.  It allows updates to
be cascaded.  Paradox tables do not support cascaded deletes.  You will have
to write your own code to delete the detail records.

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Re:can't delete a master record and its details records


Quote
>i'm using delphi 3.00 with paradox tables and i can't delete a master
>record and its details records, allthough there is a referential
>integrity defined with cascade!!! update rule between the tables. i get
>an error message - "master have details cant delete or edit record".
>the problem accurs also when the tables are opened exclusive and there
>isnt any locks on the records. i expect that by deleting the master
>record all the details record will be deleted also.

Then your expectation is incorrect.  BDE  does not support cascading
deletes.  You will have to handle that in code.  You can put code in
the master tables BeforeDelete Event to delete detail records.

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Re:can't delete a master record and its details records


Quote
Bill Todd (TeamB) wrote:
> The "cascade updates" setting means what it says<g>.  It allows updates to
> be cascaded.  Paradox tables do not support cascaded deletes.  You will have
> to write your own code to delete the detail records.

    In other words: on the BeforeDelete event of your master table you will have
to put a code to search and kill records on the detail table(s).

    See ya
    Tulius Lima

Re:can't delete a master record and its details records


Quote
>    In other words: on the BeforeDelete event of your master table you will
have
>to put a code to search and kill records on the detail table(s).

Exactly.

--
Bill

(TeamB cannot answer questions received via email.)
(To contact me for any other reason remove nospam from my address)

Other Threads