我的源码,麻烦你帮看看
procedure TServerDM.TransSave(var FKValue, JJDValue,
CLXXValue: OleVariant;
out TransException: OleVariant);
var
FKRecord : OleVariant;
JJDRecord : OleVariant;
CLXXRecord : OleVariant;
TransResult : OleVariant;
ErrCount : integer;
aTD : TTransactionDesc;
begin
aTD.TransactionID := 11902;
aTD.IsolationLevel := xilReadCOMMITTED;
FKRecord := FKValue;
JJDRecord := JJDValue;
CLXXRecord := CLXXValue;
if not Self.SQLConnPolice.InTransaction then
begin
self.SQLConnPolice.StartTransaction(aTD);
try
if not VarIsNull(FKRecord) then
FKRecord := self.dspFKXX.ApplyUpdates(FKRecord,0,ErrCount);
if ErrCount >
0 then
SysUtils.Abort;
if not VarIsNull(JJDRecord) then
JJDRecord := Self.dspJJD.ApplyUpdates(JJDRecord,0,ErrCount);
if ErrCount >
0 then
SysUtils.Abort;
if not VarIsNull(CLXXRecord) then
CLXXRecord := dspCLXX.ApplyUpdates(CLXXRecord,0,ErrCount);
if ErrCount >
0 then
SysUtils.Abort;
TransResult := Null
except
Self.SQLConnPolice.Rollback(aTD);
end;
Self.SQLConnPolice.Commit(aTD);
end;
end;