嗯,刚才测了,执行到end就是应该的choice=1或者choice=2了
但是还是没能解决问题,我在信息层的代码,只有当choice=1的时候才运行sql的update操作。
procedure TXLXX.DataSetQYLJSJJ2BeforePost(DataSet: TDataSet);
begin
if(choice=1)
then
begin
choice:= 0;
DataSetQYLJSJJ2.Connection.ExecuteSQL('update QYLJB set XH=XH + 1 where QYLJB.XLID='''+DataSetXZXLSJJ.FieldByName('XLID').AsString+''' AND XH >= ' + DataSetQYLJSJJ2.FieldByName('XH').AsString);
end
end;