100% cpu usage

J

Jim

Access 2002 adp connected to SQL server, running through
terminal services. When I execute any command through ADO
(sample below), the cpu usage immediately jumps to 100%
and stays there. Needless to say all other users (3-4)
are dead in the water until the command is done. It
occurs whether I am executing a stored procedure or
passing a sql string.

Any ideas?

Dim cmd6 As ADODB.Command
6380 Set cmd6 = New ADODB.Command
6390 cmd6.ActiveConnection = cnnConnection
6400 cmd6.CommandText = "sp_WABillPrintUpdate"
6410 cmd6.CommandType = adCmdStoredProc
6420 cmd6.Parameters.Refresh
6430 cmd6.Parameters(1).value = Me!cboBillingGroup
6440 cmd6.Execute , , adAsyncExecute
6450 Do Until cmd6.state <> adStateExecuting
6460 Loop
6470 Set cmd6 = Nothing
 
G

Guest

Thanks for the feedback. I tried that and there was no
impact on the cpu usage. Any other ideas?
 
L

Lyle Fairfield

But is there a change in "all other users (3-4) are dead in the water"?

I think the examples of "State" found in the ADO help file are less than
rigorous programming. Perhaps, in Access, to wait until execution is complete
we could use:

Do Until (cmd6.state And adStateExecuting = adStateExecuting)
DoEvents
Loop

DoEvents yields to the system, but if you are going to use it for a long
running procedure then you should read the help file carefully with repect to
it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top