Why don't you let the database take care of deleting the details-records ? - DisableControls for ClientDatasetGrid - Get ID of Previous/Next record for ClientDataset - Delete the master-record through Query/Stored procedure (database deletes details) - Refresh the ClientDataset - Return to Bookmarked record - EnableControls for ClientDatasetGrid.
-----Oorspronkelijk bericht----- Van: [EMAIL PROTECTED] namens Alan Colburn Verzonden: ma 12-02-2007 21:17 Aan: delphi-db@elists.org CC: Onderwerp: Deleting from Nested DataSets Hi Folks -- I had time this weekend to explore the app I've been working on (which I posted about last week). I finally figured out how to do what I wanted to do--the stuff about having a template-like display via nested datasets. The reason Delphi wasn't behaving the way I thought it "should" was that I am (a) saving/loading directly to disk via the ClientDataSet LoadFromStream and SaveToStream methods, and (b) ClientDataSet's LogChanges property had been set to true. Turning that property off changed everything, and it was smooth sailing after that--finally! At this point I've got just one small question left. I can't figure out how to delete a record. The main ClientDataSet's Delete method generates an exception: "Cannot delete master record with details." Looking around on the web, deleting nested records seems to require that the DataSet provider's poCascadeDeletes property(?) be set to True. As I described above, though, I'm not using a DataSetProvider component--so I don't know how to allow my app to cascade deletes. Any thoughts about what I should do? Hopefully this is an easy one! Thanks, as always -- Al C. _________________________________________________________________ Personalize your Live.com homepage with the news, weather, and photos you care about. http://www.live.com/getstarted.aspx?icid=T001MSN30A0701 _______________________________________________ Delphi-DB mailing list Delphi-DB@elists.org http://www.elists.org/mailman/listinfo/delphi-db Paul van Mil Senior Developer MAD-Systems Burg. van Suchtelenstr. 26 6641 XN Beuningen (Gld) The Netherlands Url: www.madsystems.nl Tel.: +31 (0)24-366 1501 Fax.: +31 (0)24-366 1502 Mob.: +31 (0)6 2251 4084 Email: [EMAIL PROTECTED] ************************************************************************* Disclaimer: MAD-Systems is de enige opdrachtnemer van alle werkzaamheden. Nederlands recht is van toepassing. De aansprakelijkheid van MAD-Systems is beperkt tot de uitkering die plaatsvindt onder de verzekering van MAD-Systems tegen beroepsaansprakelijkheid. Disclaimer: MAD-Systems is the exclusive contractual party with respect to all work and services undertaken. Dutch laws shall apply. The aggregate liability of MAD-Systems shall be limited to the proceeds available under MAD-Systems professional liability insurance. This e-mail message is intended exclusively for the addressee(s). If the e-mail was sent to you by mistake, would you please contact us immediately by e-mail through "[EMAIL PROTECTED]". In that case, we also request that you destroy the e-mail and that you neither use the contents nor disclose them in any manner to third parties, because the message may contain confidential information which is protected by professional secrecy. Any addressee should be aware that internet e-mail is subject to risks; MAD-Systems therefore denies any responsibility for damages resulting from the use of Internet e-mail. ************************************************************************* This email is checked on virusses through Norton Antivirus, updated 2007-02-13
_______________________________________________ Delphi-DB mailing list Delphi-DB@elists.org http://www.elists.org/mailman/listinfo/delphi-db