我有一个问题,我的AnyDac取消对话框从TADGUIxAsyncExecuteDialog组件,基本上我需要用户能够取消查询执行它完美地工作,但设计不匹配的程序我需要的是编辑表单,显示给用户我的需要,删除图标的AnyDac更改标题等。你知道我该怎么做吗?
我使用的是AnyDac 6.0.3 Build 2713 Delphi XE
我已经在互联网上搜索了一周了,但没有结果:)
发布于 2013-02-28 15:32:20
找到了解决方法:)
while AnyQuery.Command.State = csExecuting do
begin
Application.ProcessMessages;
//do anything here while query is executing
//the query has to be set to ResourceOptions.CmdExecMode = amAsync
end;
end;您还可以通过执行以下命令来取消查询
AnyQuery.AbortJob(False);我的代码如下所示:
AnyQuery.Active;
ShowProgressForm:= TShowProgressForm.Create(Application);
ShowProgressForm.Label1.Caption := 'Generating Query Please Wait...';
while AnyQuery.Command.State = csExecuting do
begin
Application.ProcessMessages;
if ShowProgressForm.Cancel then
begin
AnyQuery.AbortJob(False);
ShowProgressForm.Close;
EXIT;
end;
end;
ShowProgressForm.Close;Cancel是在ShowProgressForm.pas中声明的全局布尔变量,当您按下Cancel按钮时,该变量变为True,并且AbortJob(False)方法将中止查询执行:)
希望它能有所帮助:)
https://stackoverflow.com/questions/15067960
复制相似问题