views:

846

answers:

1

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?

A: 

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.

Re0sless
Do you mean, like, by starting out with 37 active statements and then periodically checking how many of them are still active? That doesn't seem like the right idea to me. It looks like `ActiveStatements` is only updated when a dataset opens or closes a cursor, which doesn't really apply to *insert* and *update* queries, does it?
Rob Kennedy
I'm using ADOConnection. Sorry, forgot to mention it.
Vlad