Re: OTHER BIG BUG : deleting detail master delete




"Cavalera Guido" <cavaleraguido@xxxxxxxxxxxx> wrote in message
news:46567b2a@xxxxxxxxxxxxxxxxxxxxxxxxx
D2006+ADODataSet+SQLServer

In a master detail relation with transaction and batchoptimistic control,
happen that if i delete a detail record then in UpdateBatch also master
record is deleted from database table but not in a dataset !!!!

If you have a reference to the master table in the detail query, ADO tries
to be really smart and assume you want all related data in each joined table
deleted. This is "as designed" by Microsoft and not a bug.

Again, IMO, the best long term solution is to put the work on the server
(cascade delete trigger), not the client. If the target database is unknown
(could be MSSQL, Oracle, etc) and/or the DBA won't let you in 100ft of the
server, use TClientDataSet<->TDataSetProvider<->TADODataSet. You have
complete control over what SQL scripts are generated and compatible with
nearly all RDBMSs.

Good luck,
krf


.



Relevant Pages

  • Re: ANN: Special kbmMW timelimited offer!
    ... On each master change, get a new matching detail record from the database. ... > What about Master-Detail support? ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: OTHER BIG BUG : deleting detail master delete
    ... database and i want to delete 'simple' a detail record in a table, ADO ... In a master detail relation with transaction and batchoptimistic ...
    (borland.public.delphi.database.ado)
  • Re: Updating Picture on Main Form from Sub Form
    ... a master table and a detail table with multiple detail ... The detail record includes an ole field that is used to contain pictures. ... included the picture in a bound object frame and works. ... unlike VB, it has image, unbound object frame and bound object frame. ...
    (microsoft.public.access.formscoding)
  • Re: Master/Detail + cachedUpdates
    ... > When inserting a new detail record, the linking data is not automatically ... Please be aware that cachedupdates is problematic with linked Master Detail ... dataset situations. ... circumvent this is to apply both master and detail updates in the master ...
    (comp.lang.pascal.delphi.misc)
  • Need example of sophisticated master/detail GUI
    ... good visual context as they drill down from the master to a detail ... and then to a detail record of the detail record.... ...
    (comp.lang.java.gui)