• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 704
  • Last Modified:

increase timeout ms sql 2005 queries from asp

I have this code in an asp script.

It times out too often. How can I icrease the timeout time?

From the ms sql manager it does not tine out, Can it be a connection string issue?

Set MyRecordSet = Server.CreateObject("ADODB.RecordSet")
cn = application("connection")
sql="select count(*) as cuantos from people"
MyRecordSet.Open sql, cn

Open in new window

  • 3
  • 2
  • 2
1 Solution
cn.timeout = 900 (this is 900 seconds=15 minutes)
robrodpAuthor Commented:
cn is the connection string defined in global.asa as:


So the  cn.timeout = 900
(this is 900 seconds=15 minutes)
does not work
my bad
i was sure cn is a connection object
you can try what is describe here
but it seems weird
if you create a connection object (which is probably created implicitly so your won't hurt performance)
 you can set its timeout property
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:
Thinking the other way around, why is your query taking much time..
If you tune it out and bring it out to less time, then no timeouts issues, right..
robrodpAuthor Commented:
Good it works
Now how can I increase the timeout for:

c.Open cn
sql="update table set name='john' where id=123
c.Execute sql
set c = nothing
robrodpAuthor Commented:
I have tuned it with indexes
Raja Jegan RSQL Server DBA & Architect, EE Solution GuideCommented:
After creating your indexes and if you tune out your query, then I am sure you wont face any Timeout issues.

create indexes on the columns in Where clause and joins to improve performance
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now