increase timeout ms sql 2005 queries from asp

Posted on 2009-02-19
Last Modified: 2012-05-06
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

Question by:robrodp
    LVL 37

    Expert Comment

    cn.timeout = 900 (this is 900 seconds=15 minutes)

    Author Comment

    cn is the connection string defined in global.asa as:


    So the  cn.timeout = 900
    (this is 900 seconds=15 minutes)
    does not work
    LVL 37

    Accepted Solution

    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
    LVL 57

    Expert Comment

    by:Raja Jegan R
    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..

    Author Comment

    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

    Author Comment

    I have tuned it with indexes
    LVL 57

    Expert Comment

    by:Raja Jegan R
    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Why You Should Analyze Threat Actor TTPs

    After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

    Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
    In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…
    Internet Business Fax to Email Made Easy - With eFax Corporate (, you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

    761 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now