displaying a progress bar that shows the execution of a tadoquery

displaying a progress bar that shows the execution of a tadoquery

Post by Delph » Fri, 18 Jul 2003 22:22:55



I am looking for displaying a progress bar that shows the execution of a
tadoquery. I have found something useful, capturing the OnFetchProgress
event, but I don't know why it is not workking at all.

This is the code I wrote

procedure TForm1.ADOQuery2FetchProgress(DataSet: TCustomADODataSet;
  Progress, MaxProgress: Integer; var EventStatus: TEventStatus);
begin
  Caption := 'Percent complete: ' +
  IntToStr(Trunc(Progress / MaxProgress * 100)) + '%';
  Application.ProcessMessages;
  progressbar1.Max:=MaxProgress;
  progressbar1.position:=PROGRESS;
  Application.ProcessMessages;
end;