OnUpdateRecord with SDAC 4.50
Posted: Thu 31 Jul 2008 20:47
Hi,
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:
I called then simply msquery.StandardApply(ukDelete) in the OnUpdateRecord handler - example:
With 4.50, the "standardapply" code does not get compiled any more.
Please, could you tell me, how could I implement such very needed behavior with SDAC 4.50?
Thanks.[/code]
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]