比如在数据集导航条的BeforeAction事件中这样写
procedure TMainForm.DataNavigator1BeforeAction(Sender: TObject; var Accept: Boolean);
var
lTransactionHandle: TTransactionHandle;
lUpdateSql: string;
begin
case (Sender as TBizDataSetAction).ID of
BizActnConsts.ActionDataSetDelete: //判断点击的是否是删除按钮
begin
if JsDialogs.ConfirmBox('确定删除吗?','提示信息',1) then
begin
lTransactionHandle := dsbMaster.DataSet.Connection.Transaction.Start(False); //启动事务,保证数据集的删除和update语句在一个事务里
try
lUpdateSql := ' update Table1 set khid = ''0000'' '+
' where khid = ''0003'' ';
dsbMaster.DataSet.Connection.ExecuteSQL(lUpdateSql); //发update语句