Data.Win.ADODB.TCustomADODataSet.OnFetchProgress
Delphi
property OnFetchProgress: TFetchProgressEvent read FOnFetchProgress write FOnFetchProgress;
C++
__property TFetchProgressEvent OnFetchProgress = {read=FOnFetchProgress, write=FOnFetchProgress};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
event | published | Data.Win.ADODB.pas Data.Win.ADODB.hpp |
Data.Win.ADODB | TCustomADODataSet |
Description
Occurs periodically during an asynchronous data retrieval operation.
Write an OnFetchProgress event handler to take specific action during an asynchronous data retrieval operation. The OnFetchProgress event fires periodically during the data retrieval to provide indications of its progress. Create a handler for this event to react to this periodic notification, such as providing the user with a visual indication of the progress of the data retrieval.
DataSet is the ADO dataset component that triggered the OnFetchProgress event. This dataset component also contains the recordset in question.
Progress is the number of records that have been received since the data fetching operation began.
MaxProgress is the total number of records to be retrieved by the operation.
Progress and MaxProgress used together to get percent complete. For example, Progress divided by MaxProgress and multiplied by 100 yields the percent completion of the data fetching.
procedure TForm1.ADODataSet1FetchProgress(DataSet: TCustomADODataSet; Progress, MaxProgress: Integer; var EventStatus: TEventStatus);
begin
Caption := 'Percent complete: ' +
IntToStr(Trunc(Progress / MaxProgress * 100)) + '%';
Application.ProcessMessages;
end;
void __fastcall TForm1::ADODataSet1FetchProgress(TCustomADODataSet *DataSet, int Progress, int MaxProgress, TEventStatus &EventStatus)
{
Caption = "Percent complete: " +
IntToStr(Trunc(Progress / MaxProgress * 100)) + "%";
Application->ProcessMessages;
}