2,497
社区成员
发帖
与我相关
我的任务
分享
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, DB, ADODB;
type
TForm1 = class(TForm)
ADOTable1: TADOTable;
procedure ADOTable1FetchProgress(DataSet: TCustomADODataSet; Progress,
MaxProgress: Integer; var EventStatus: TEventStatus);
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.ADOTable1FetchProgress(DataSet: TCustomADODataSet;
Progress, MaxProgress: Integer; var EventStatus: TEventStatus);
begin
//在这里添加代码更新进度条
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
{以下代码让ADO执行异步操作,即不论取数据时间多么长,都不会阻塞主线程,不会导致用户界面无响应}
ADOTable1.ExecuteOptions:=[eoAsyncFetchNonBlocking];
end;
end.