ADO timeout

  • What is the default connection timeout value for ADO? I'm getting lots of timeout errors running simple stored procs from VB code. Is this the only value I would need to increase?

    Thanks for any help.

  • Hi hoodg,

    MSDN says default value is 15 seconds for connection Timeout (CommandTimeout = 30 seconds).

    Maybe you need to increase also CommandTimeout like this

    With cnnAttach

    .CommandTimeout = your value

    .ConnectionTimeout = your value

    End With

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Of the two, it's normally command timeout you want to increase. There are certainly times when increasing it is the right thing to do, but do change with caution. If you set the timeout high, potentially your query will block others for that much longer. Ideally you want to tune the query first to get the time below 30 secs. I say 30 secs because that IS the default, so if you run queries longer you risk breaking other stuff (due to blocking) that doesn't have the advantage of a longer timeout.

    Andy

    http://qa.sqlservercentral.com/columnists/awarren/

  • I increased the default value only in a small self-made tool that stores (large) binary data into one certain db. If filesize gone beyond ~5-6 MB I ran into timeout problems. Normally I had no problems with the default values.

    Cheers,

    Frank

    --
    Frank Kalis
    Microsoft SQL Server MVP
    Webmaster: http://www.insidesql.org/blogs
    My blog: http://www.insidesql.org/blogs/frankkalis/[/url]

  • Thanks for the replies. Maybe I should be looking server side - my queries are not that complex and only return around 2000 rows and usually does it in 3-4 secs in QA. My DBA says he sees nothing related in the logs. Is there anything specific could be researched/done on the server?

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply