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;


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM