TransProcessingU1.pas
上传用户:fh681027
上传日期:2022-07-23
资源大小:1959k
文件大小:1k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. unit TransProcessingU1;
  2. interface
  3. uses
  4.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  5.   Dialogs, StdCtrls, DB, ADODB, Grids, DBGrids, ExtCtrls;
  6. type
  7.   TForm1 = class(TForm)
  8.     Panel1: TPanel;
  9.     DBGrid1: TDBGrid;
  10.     ADOConnection1: TADOConnection;
  11.     ADOTable1: TADOTable;
  12.     DataSource1: TDataSource;
  13.     Button1: TButton;
  14.     Button2: TButton;
  15.     Button3: TButton;
  16.     procedure Button1Click(Sender: TObject);
  17.     procedure Button2Click(Sender: TObject);
  18.     procedure Button3Click(Sender: TObject);
  19.   private
  20.     { Private declarations }
  21.   public
  22.     { Public declarations }
  23.   end;
  24. var
  25.   Form1: TForm1;
  26. implementation
  27. {$R *.dfm}
  28. procedure TForm1.Button1Click(Sender: TObject);
  29. begin
  30.   ADOConnection1.BeginTrans;
  31. end;
  32. procedure TForm1.Button2Click(Sender: TObject);
  33. begin
  34.   ADOConnection1.CommitTrans;
  35. end;
  36. procedure TForm1.Button3Click(Sender: TObject);
  37. begin
  38.   ADOConnection1.RollbackTrans;
  39. end;
  40. end.