如何用ProgressBar来反映SQL查询时的进度?

synergy 2000-06-07 10:58:00
如何用ProgressBar来反映SQL查询时的进度?
...全文
293 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
menxin 2000-06-26
  • 打赏
  • 举报
回复
RXLIB!!!
看看他的例子就行了。
cfire 2000-06-26
  • 打赏
  • 举报
回复
大哥,这是不可能做到的。
liuyangnc 2000-06-20
  • 打赏
  • 举报
回复
确实不可能!
coding 2000-06-19
  • 打赏
  • 举报
回复
不可能,因为查询在服务器端运行,有很多因素(锁定..),除非用TABLE 自已写。
bruce_zhao 2000-06-13
  • 打赏
  • 举报
回复
我查阅过很多书籍及各种网络资料,得出的结论是没有办法用ProgressBar来反映SQL查询时的进度!现粘贴一段文章如下:

Question

How can i draw a gauge bar during a tquery.open session? I know the record
count of the table (=100%), but how can i get the actual record, which tquery
is processing? how can i operate during running query?
Answer

A:
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版本试试!
ymxxm 2000-06-09
  • 打赏
  • 举报
回复
可以用Thread 试试
thinking_man 2000-06-08
  • 打赏
  • 举报
回复
同意以上的观点,不过,如果按JLL所说,速度会很慢的。
jll 2000-06-08
  • 打赏
  • 举报
回复
进度一般要自己编写,可以试试在查询了多少记录后给出一个进度提示...
madfish 2000-06-07
  • 打赏
  • 举报
回复
我想不可能!
因为你无法预计 SQL查询(应该是网络数据库吧?比如说,如果网络中断?) 的进度。而且,查询是在服务器端进行,得出结果之后,才回传到客户端。当然,如果你用多线程进行后台查询,则可以显示一些动态的等待动画,并且可以让用户中断查询(强行中断查询进程)。

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧