Page 1 of 1

Best way to insert / update / delete records

Posted: Tue 25 Nov 2008 13:14
by jkuiper
I have a table witch contents a group of conditions connected to several groups like this
  • group condition
    001 02
    001 05
    001 07
    020 02
    020 08
For me is the best way to save the group at once and not by record.
The conditions are showed in a listbox. In the listbox items can be added / removed.
I have experienced with TMyLoader, but this component will only insert. TcrBatchmove can insert /update, but not deleted records.

I prefer using Virtualtable, because tclientdataset requires midas.dll and will not alway be loaded on pc's / notebooks.

So, can MyDAC components insert / update / delete by one click?

Posted: Wed 26 Nov 2008 12:27
by Dimon
If you need to transfer record from VirtualTable to MySQL Server using MyDAC components, you should use the TCRBatchMove component. You should execute the TCRBatchMove.Execute method two times - first time in the bmAppendUpdate mode and second time in the bmDelete mode.

Posted: Thu 27 Nov 2008 18:58
by jkuiper
Thanks, but then I have to loop the query twice. For me it's a performance issue. Now I have it working with TClientdataset. with applyupdate() it will do all at once.

Posted: Mon 01 Dec 2008 08:40
by Dimon
You can use the TMyQuery component directly. But if you have to use TClientDataSet, you can connect it with TMyQuery using the TDataSetProvider component.