ado command timeout property

L

Loane Sharp

Hi there

When I retrieve an ADO recordset using a fairly long-running query from SQL
Server (a minute or so to return results), I sometimes (unpredictably?)
encounter a VBA timeout error. I have set the ADO connection object's
timeout property to 0 ("infinite"). The recordset itself is created using
the ADO command object, and I've set the command timeout value to 0
("infinite"). The recordset object (understandably?) does not have a timeout
property. I have experimented with different timeout values (up to 3000000)
for both the command and connection objects, but it makes no difference.

This makes it very difficult to run the procedure unattended.

Perhaps the timeout arises on SQL Server's end? Or if, on the other hand,
the error arises because the ADO "timeout" properties are not very
effective, perhaps there is some way that I can trap the timeout error and
attempt to requery the dataset when a timeout error occurs?

Any help would be greatly appreciated.

Best regards
Loane
 

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