delphi执行查询语句时的进度条怎么做

procedure TForm1.FormCreate(Sender: TObject); 
begin  
  ADOQuery1.ExecuteOptions := [eoAsyncFetch];//设为异步读取 
end; 
//ADOQuery的OnFetchProgress事件 
procedure TForm1.ADOQuery1FetchProgress(DataSet: TCustomADODataSet; Progress, MaxProgress: Integer; var EventStatus: TEventStatus); 
begin  
  ProgressBar1.Position := Progress; 
  ProgressBar1.Max := MaxProgress; 
end; 
//ADOQuery的OnFetchComplete事件 
procedure TForm1.ADOQuery1FetchComplete(DataSet: TCustomADODataSet; const Error: Error; var EventStatus: TEventStatus); 
begin  
  ProgressBar1.Position := ProgressBar1.Max; 
  ShowMessage('OK'); 
end;

摘自:http://topic.csdn.net/u/20090831/17/39916a74-70db-4aeb-9f36-72142e00d454.html

你可能感兴趣的:(Delphi)