我想不可能!
因为你无法预计 SQL查询(应该是网络数据库吧?比如说,如果网络中断?) 的进度。而且,查询是在服务器端进行,得出结果之后,才回传到客户端。当然,如果你用多线程进行后台查询,则可以显示一些动态的等待动画,并且可以让用户中断查询(强行中断查询进程)。
因为你无法预计 SQL查询(应该是网络数据库吧?比如说,如果网络中断?) 的进度。而且,查询是在服务器端进行,得出结果之后,才回传到客户端。当然,如果你用多线程进行后台查询,则可以显示一些动态的等待动画,并且可以让用户中断查询(强行中断查询进程)。
解决方案 »
- Vista与Win7下如何制作嵌入到桌面上的程序
- cxGrid显示问题 在线等 分不够再加
- 请高人帮忙把这段C系列的代码转成Delphi的...
- 我想锁住Dbgrid中的前两个字段怎么实现呀?
- 请问:如何用最简单的方法!把两个数据库内的表进行比较然后把不同的插入即可!
- 怎样用线程控制Form 中的暂停和停止按钮???
- 如何限制鼠标的活动范围。。。
- 为什么DELPHI6生成的文件在英文WIN98的部分机器上无法运行(安装ADO后正常了)
- delphi中三层结构,是个什么样的原理和实现方法?
- bmp2gif如何转换?
- 请高手指教如何使用delphi在程序中收发电子邮件
- 我用wingate做代理服务器工作站该怎么设?
count of the table (=100%), but how can i get the actual record, which tquery
is processing? how can i operate during running query?
AnswerA:
Not possible.
没有可能!!The idea behind the TQuery object is to have a SQL server process the
request in the background and take the local machine completely out of
the loop. The app is never supposed to know what the TQuery is doing,
so a gauge that measures progress would have to get its data from a
SQL server. Since most SQL servers dont publish this info, you are
probably out of luck on this one...A:
If you're using Paradox or DBase I think you can use the
如果你是使用 Paradox 或者 DBase,我想你可以使用DBIRegisterCallback凾数DBIRegisterCallback function>From the DBE users manual:Usage:
Callbacks are used when a client application needs clarification about a given
engine function before completing an operation or to return information to the
client. DBIRegisterCallback allows the client to instruct the database engine
about what further actions should be taken by the engine upon occurence of an
event.I've never used it before, so I can't give you the details.不过,在Rxlib2.75中有个DBProgress,据帮助文件说可以显示QUERY的进度,但我没有试过,不好说。你可以到http://delphis.yeah.net的“Rxlib专栏”中下载2。75版本试试!
看看他的例子就行了。