部分代码如下,因为执行的存储过程时间比较长,所以就用一个进度条来显示这段时间
但是,我的那两个方法都为被调用,进度条也没有显示什么,
忘高手指点...
存储过程是:
update table set color=color1 where color=color2
.
.
.
11张表都是这样的修改...
-----------------------------------------------------
qryPro := TADOQuery.Create(nil);
qryPro.ExecuteOptions := [eoAsyncFetchNonBlocking];
qryPro.OnFetchProgress := qryProSetFetchProgress;
qryPro.Close;
Connection.ConnectOptions :=coAsyncConnect;
qryPro.Connection := Connection;
qryPro.CommandTimeout := 1800;
qryPro.SQL.Clear;
qryPro.SQL.Text := ' exec sp_RefreshColor '''+color1+''','''+color2+''','''+msg+''' ';
qryPro.ExecSQL;-----------------------------------------------------procedure TPPSampleSendCustFrm.qryProFetchComplete(
DataSet: TCustomADODataSet; const Error: Error;
var EventStatus: TEventStatus);
begin
SystemInfo('end_!',0);
end;procedure TPPSampleSendCustFrm.qryProFetchProgress(
DataSet: TCustomADODataSet; Progress, MaxProgress: Integer;
var EventStatus: TEventStatus);
begin CttProgressBar1.Position := (Progress*100) div MaxProgress ;
CttProgressBar1.Properties.Max := MaxProgress;
Application.ProcessMessages;end;
但是,我的那两个方法都为被调用,进度条也没有显示什么,
忘高手指点...
存储过程是:
update table set color=color1 where color=color2
.
.
.
11张表都是这样的修改...
-----------------------------------------------------
qryPro := TADOQuery.Create(nil);
qryPro.ExecuteOptions := [eoAsyncFetchNonBlocking];
qryPro.OnFetchProgress := qryProSetFetchProgress;
qryPro.Close;
Connection.ConnectOptions :=coAsyncConnect;
qryPro.Connection := Connection;
qryPro.CommandTimeout := 1800;
qryPro.SQL.Clear;
qryPro.SQL.Text := ' exec sp_RefreshColor '''+color1+''','''+color2+''','''+msg+''' ';
qryPro.ExecSQL;-----------------------------------------------------procedure TPPSampleSendCustFrm.qryProFetchComplete(
DataSet: TCustomADODataSet; const Error: Error;
var EventStatus: TEventStatus);
begin
SystemInfo('end_!',0);
end;procedure TPPSampleSendCustFrm.qryProFetchProgress(
DataSet: TCustomADODataSet; Progress, MaxProgress: Integer;
var EventStatus: TEventStatus);
begin CttProgressBar1.Position := (Progress*100) div MaxProgress ;
CttProgressBar1.Properties.Max := MaxProgress;
Application.ProcessMessages;end;
解决方案 »
- stringgrid 分页显示
- 为什么在fastreport中不能打印SQL2000中的image字段的内容呢?
- 关于progressbar与数值同步的问题,答完给分
- 在DELPHI 中通ADO 取vfp 表後,更新vfp一字段時用updaterecord,post,updatebatch (),大部分更新沒問題,極小一部分更新有問題
- 虽然没有分,大家还是看看,急啊!!!
- 斑竹不要删除!我要招聘一个编程人员!谢谢!我实在找不到合适的!没有办法!鼠下留情!
- 会者不难(关于sql)
- 请问 多线程中能否共用一个AdoConnection连接
- COM编程:CoCreateInstanceEx()问题:无法向注册表写入项,错误代码-2147221164
- Delphi6 中 ValueListEditor 控件的输入法问题
- 如何用api函数来打印Timage
- dbgrid如何赋值?
CttProgressBar1.Properties.Max := MaxProgress;
qryProFetchComplete
qryProFetchProgress这两个方法中用:systeminf(...);都没有显示
所以我是确定这两个方法没有被调用..
--
function MyThreadFun : Boolean;stdcall;
--这是实际条用的过程var hThread:Thandle; ThreadID:DWord;
ThreadID := CreateThread(nil,0,@MyThreadFun,nil,0,hThread);
....//执行存储工程
.
.
.
--
function TPPSampleSendCustFrm.MyThreadFun :Boolean;stdcall;
begin
....//循环,使进度条滚动
end;
????????
谁能帮帮我????????
不要贴网上的代码,谢谢........