正在处理进度条上显示的 MySQL 查询
我有一个表单,通过 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您使用的是 DBExpress TSQLconnection,它有一个属性 ActiveStatements
因此,如果您添加一个每 N 秒触发一次的计时器,当它触发时,请检查 ActiveStatements 属性并更新您的状态因此。
更新:
正如 Rob Kennedy 在评论中正确指出的那样,ActiveStatements 不显示插入或更新语句,因此它无法满足您的需求。
不过,TADOConnecttion 确实具有 OnWillExecute 和 OnExecuteComplete 事件,这些事件在执行命令之前或之后触发,因此可以对它们执行某些操作,我刚刚测试了它,它们确实可以处理更新语句。
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.