Board index » delphi » Only cancel record in dsInsert state
Herman
![]() Delphi Developer |
Only cancel record in dsInsert state2007-07-04 10:20:24 PM delphi9 Hello, I have a TSQLQuery, TClientDataSet construction to FireBird 2. I have next procedure procedure From.BeforePost(DataSet: TDataSet); begin if SomethingWrong then Abort; end; When 2 lines are correctly added and a 3rd one is in the dsInsert state and SomethingWrong is the case, Abort is called and the 3rd line is removed. But the first 2 lines are also gone. Then I tried procedure From.BeforePost(DataSet: TDataSet); begin if SomethingWrong then try Abort; except Cancel; end; end; This works but causes exceptions when applying updates (can not find record), I think this is the deleted 3rd (insert) record Does anyone have a decent solution for this? Thanks in advance Herman |