正在处理进度条上显示的 MySQL 查询

发布于 2024-07-30 13:31:33 字数 139 浏览 0 评论 0原文

我有一个表单,通过 INSERT 或 UPDATE 查询将大约 37 个值传递到 MS Access 库。 实际上它发生得非常快,所以我希望在进度条上指示这个过程只是一个奇特的功能。 如何将 mysql 查询执行绑定到进度条填充? 或者我应该效仿这种相对论?

I have form that passes about 37 values to MS Access base with INSERT or UPDATE query. Actually it happens very fast so my wish to indicate this process on progress bar is just a fancy feature. How can I bind mysql query execution to progress bar filling? Or should I just emulate this relativity?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

第七度阳光i 2024-08-06 13:31:33

如果您使用的是 DBExpress TSQLconnection,它有一个属性 ActiveStatements

因此,如果您添加一个每 N 秒触发一次的计时器,当它触发时,请检查 ActiveStatements 属性并更新您的状态因此。

更新:
正如 Rob Kennedy 在评论中正确指出的那样,ActiveStatements 不显示插入或更新语句,因此它无法满足您的需求。

不过,TADOConnecttion 确实具有 OnWillExecuteOnExecuteComplete 事件,这些事件在执行命令之前或之后触发,因此可以对它们执行某些操作,我刚刚测试了它,它们确实可以处理更新语句。

If you are using a DBExpress TSQLconnection, it has a property ActiveStatements

So if you add a timer that fires every N seconds, when it fires check the ActiveStatements property and update your status accordingly.

Update:
As correctly pointed out by Rob Kennedy in the comments, ActiveStatements does not show insert or update statements so it will not work for what you want.

TADOConnecttion does however have the OnWillExecute and OnExecuteComplete events that fire before or after a command is executed, so it may be possible to do something with them, I just tested it and they do work on update statements.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文