unit View.Main;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms, Dialogs,
DB, DBAccess, Uni, UniProvider,
MySQLUniProvider, StdCtrls, ExtCtrls;
type
TForm1 =
class( TForm )
MySQLUniProvider1 : TMySQLUniProvider;
UniConnection1 : TUniConnection;
Timer1 : TTimer;
CheckBox1 : TCheckBox;
procedure CheckBox1Click( Sender : TObject );
procedure Timer1Timer( Sender : TObject );
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1 : TForm1;
implementation
{$R *.dfm}
procedure TForm1.CheckBox1Click( Sender : TObject );
begin
Timer1.Enabled := CheckBox1.Checked;
end;
procedure TForm1.Timer1Timer( Sender : TObject );
begin
Timer1.Enabled := False;
if not UniConnection1.Connected
then
UniConnection1.Open;
UniConnection1.StartTransaction;
try
UniConnection1.ExecSQL( '
INSERT INTO beltab (BelTyp, BelInfo) VALUES(:BelTyp,:BelInfo);',
['
RECHNUNG', '
Nur so'] );
Sleep( 250 );
if Random( 2 ) = 1
then
UniConnection1.Commit
else
UniConnection1.Rollback;
except
UniConnection1.Rollback;
end;
Timer1.Enabled := CheckBox1.Checked;
end;
end.