菜鸟求助,大家帮帮忙!!
为什么提示TTransactionDesc没定义,我在uses后加上了TTransactionDesc,却又提示TTransactionDesc.dcu没找到。我是按帮助里面的例子来得,why?
或者事务处理应该怎么写,谢谢,
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); {on success, commit the changes};
    except      SQLConnection1.Rollback(TD); {on failure, undo the changes};
    end;
  end;
end;