2,497
社区成员
发帖
与我相关
我的任务
分享
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB, ComCtrls, StdCtrls;
type
TForm2 = class(TForm)
ADOQuery1: TADOQuery;
ADOQuery2: TADOQuery;
Button1: TButton;
ProgressBar1: TProgressBar;
ADOConnection1: TADOConnection;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var
stepIt : integer;
begin
adoQuery1.close;
adoquery1.SQL.Text := 'select * from a';
AdoQuery1.Open ;
adoQuery2.Close;
adoquery2.SQL.Text := 'select * from b';
adoquery2.Open;
ProgressBar1.Max := ADOQuery1.RecordCount;
stepIt := 1;
ProgressBar1.StepBy(1);
with adoquery1 do while not eof do
begin
adoquery2.Append;
ProgressBar1.Position := stepIt;
Application.ProcessMessages;
ADOQuery2.FieldByName('a').Value := FieldByName('a').Value;
inc(stepIt);
Next;
end;
end;
end.