I sometimes need to make some other update operation within OnUpdateRecord-event than the user made in the dataset - typically: user edited a dataset and cleared a value and i need to delete the record, not only modify it to NULL.
I programmed a subclass of TMSQuery full of useful code and among others I also included following method:
Code: Select all
procedure TMyMSQuery.StandardApply(updatekind: TUpdateKind);
begin
case UpdateKind of
ukModify:
PerformUpdate;
ukInsert:
PerformAppend;
ukDelete:
PerformDelete;
end;
end;
Code: Select all
if UpdateKind = ukModify then begin
if varIsNull(myfield.NewValue)
myquery.standardapply(ukDelete)
else
myquery.standardapply(ukModify)
end;
Please, could you tell me, how could I implement such very needed behavior with SDAC 4.50?
Thanks.[/code]