ADO Recordset timeout on MS SQL Server

Are you getting ADO timeout errors when connecting to SQL Server using VBScript and also using recordsets instead of command objects?

If you are not creating a connection object and just passing a connection string to the recordset, just set the CommandTimeout directly:

Dim rs

Set rs = Server.CreateOjbect(“ADODB.Recordset”)

rs.ActiveConnection = your connection string goes here

rs.ActiveConnection.CommandTimeout = 120

Of course it is also possible to redesign your queries or change the indexes on your tables for better performance. If your query is returning a lot of data, however, indexes and redesign may not be possible.

6 Responses To  “ADO Recordset timeout on MS SQL Server”
  • Bruce

    Hi, just wanted to let you know that this helped me out. Thanks much for having this out there.

  • Siddhant

    This is very useful info and i appreciate that you shared it. Thanks a lot!

  • Jason B

    Genius! You saved me hours of work with that little Gen!

  • Doug

    THanks – was looking for the nomenclature and this helped me out. thanks

  • Doug Clem

    Many thanks for sharing this, saved me lots of time. Thanks again.

  • kcid

    Hi this really save my ass at work. thanks

Leave A Reply