You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

66 lines
1.4 KiB
Plaintext

11 months ago
unit u_clear;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, bsSkinCtrls, DB, ADODB;
type
TForm1 = class(TForm)
Memo1: TMemo;
Button1: TButton;
bsSkinGauge1: TbsSkinGauge;
ADOConnection1: TADOConnection;
ADOQuery1: TADOQuery;
procedure ADOConnection1BeforeConnect(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ADOConnection1BeforeConnect(Sender: TObject);
begin
ADOConnection1.ConnectionString:='FILE NAME='+ExtractFilePath(ParamStr(0))+'sql.udl';
end;
procedure TForm1.Button1Click(Sender: TObject);
var
i:integer;
begin
for i:=0 to Memo1.Lines.Count-1 do
begin
if trim(Memo1.Lines[i])<>''then
begin
ADOQuery1.close;
ADOQuery1.sql.clear;
ADOQuery1.sql.add('Select * from '+Memo1.Lines[i]);
ADOQuery1.Open;
if not ADOQuery1.IsEmpty then
begin
bsSkinGauge1.MaxValue:=ADOQuery1.RecordCount;
bsSkinGauge1.Value:=0;
while not ADOQuery1.eof do
begin
ADOQuery1.delete;
bsSkinGauge1.Value:=bsSkinGauge1.Value+1;
Form1.Caption:=trim(Memo1.Lines[i])+ADOQuery1.Fields[0].AsString;
end;
end;
end;
end;
showmessage('ok');
end;
end.