1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
var
Qry:TIBquery;
no_facture,mt_ttc:string;
Transaction1:TIBTransaction;
begin
Transaction1 := TIbTransaction.Create(DMTactile);
With Transaction1 do
begin
// configurer correctement le composant
end;
DMTactile.NewQry(Qry);
With Transaction1 do
try
StartTransaction;
with qry do
begin
if Active then close;
SQL.Clear;
SQL.Add('update ENTETES_RESA set CDE_ACTIF= ''N'' '
+ ' where cde_codresa = :codresa and cde_noenreg = :noenreg and cde_nbnuits =:nbnuits ') ;
ParamByName('codresa').AsFloat := codresa_;
ParamByName('noenreg').Asinteger := noenreg_;
Parambyname('nbnuits').AsInteger := nbnuits_ ;
Try
ExecSQL;
Commit;
MessageDlg('Essai commit', mtWarning, [mbOK], 0);
Except on E:Exception do
begin
MessageDlg('erreur :' + E.Message, mtWarning, [mbOK], 0);
RollBack;
end;
end;
end;
finally
DMTactile.DestroyQRY(Qry);
Transaction1.free;
end;
end; |