question about adAsyncExecute option
Posted on 2007-09-27
When you run a query in the Query Analyzer from a client PC, all work will be done on the server, If you open the task manager you will see that the usage of client's CPU hardly get increased at all. but at the same time the GUI in client PC still keeps responding, there is even a moving timer.
However, I tried to execute the same query in my VB program (running on the same PC) using command object. the problem I have is if I use adAsyncExecute option, and keep a while loop to check command.state = adStateExecuting, the VB GUI will be responding but CPU usage will be up to about 50%; and If I don't use the option, CPU usage won't increase but it freezes up the GUI.
Does anyone know how to keep CPU usages low and program responding at the same time, like the Query Analyzer does?
Thanks in advance