procedure TForm1.TransferButtonClick(Sender: TObject);
var
Amt: Integer;
TD: TTransactionDesc;
begin
if not SQLConnection1.InTransaction then //如果目前不在一个事务中
begin
TD.TransactionID := 1;
TD.IsolationLevel := xilREADCOMMITTED;
SQLConnection1.StartTransaction(TD);
try
Amt := StrToInt(AmtEdit.Text);
Debit.Params.ParamValues['Amount'] := Amt;
Credit.Params.ParamValues['Amount'] := Amt;
SQLConnection1.Commit(TD); //一切顺利则递交
except
SQLConnection1.Rollback(TD); //发生任何错误则回滚
end;
end;
end;
为什么报"TTransactionDesc"是: 未说明的标识符,应该怎样做?
var
Amt: Integer;
TD: TTransactionDesc;
begin
if not SQLConnection1.InTransaction then //如果目前不在一个事务中
begin
TD.TransactionID := 1;
TD.IsolationLevel := xilREADCOMMITTED;
SQLConnection1.StartTransaction(TD);
try
Amt := StrToInt(AmtEdit.Text);
Debit.Params.ParamValues['Amount'] := Amt;
Credit.Params.ParamValues['Amount'] := Amt;
SQLConnection1.Commit(TD); //一切顺利则递交
except
SQLConnection1.Rollback(TD); //发生任何错误则回滚
end;
end;
end;
为什么报"TTransactionDesc"是: 未说明的标识符,应该怎样做?
Unit
DBXpresstype TTransactionDesc = packed record TransactionID : LongWord;
GlobalID : LongWord;
IsolationLevel : TTransIsolationLevel;
CustomIsolation : LongWord;
end;