How to see progress of query execution during handle?

后端 未结 1 563
一个人的身影
一个人的身影 2020-12-10 20:56

I used the following code in delphi for handle :

procedure TForm1.ADOQuery1FetchProgress(DataSet: TCustomADODataSet; Progress,

  MaxProgress: Integer; var E         


        
1条回答
  •  半阙折子戏
    2020-12-10 21:09

    you must set property ExecuteOptions to eoAsyncFetch before to call the open procedure

    check this sample

    with ADOQuery1 do
    begin
     SQL.Clear;
     SQL.Add('select * from tbl1 where id = '+Edit1.Text);
     ExecuteOptions:=[eoAsyncFetch];
     Open;
    end;
    
    
    procedure TForm1.ADOQuery1FetchProgress(DataSet: TCustomADODataSet; Progress,
      MaxProgress: Integer; var EventStatus: TEventStatus);
    begin
      ProgressBar1.Max      :=MaxProgress;
      ProgressBar1.Position :=Progress;
      Application.ProcessMessages;
    end;
    

    0 讨论(0)
提交回复
热议问题