Results 1 to 8 of 8

Thread: Must be a way....

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    29

    Must be a way....

    to change the timeout setting, but no-one has been able to tell me how....... YET!!!!

    Any ideas.....

    This is the error

    Code:
    Microsoft OLE DB Provider for SQL Server error '80040e31' 
    
    Timeout expired

  2. #2
    New Member
    Join Date
    Jan 2003
    Posts
    3
    Do you use ADO ?

    dim oConn as new ADODB.Connection
    oConn.CommandTimeout =60 ' modify this if you want to execute time consuming SQL statements
    oConn.Open( strConnString)

    oConn.Execute strSQLStatement,,adcmdText

  3. #3
    Registered User
    Join Date
    Dec 2002
    Location
    St. Louis Mo. Metro area
    Posts
    11
    There is also a Query Timeout value inside SQL Server that can be editted through Enterprise Manager......

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    29
    Thx all.

    Can you please tell me how to change the querytimeout thru Enterprise Manager!?

    L

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Nov 2002
    Posts
    29
    No still does not work,

    I changed the timeout programatticaly AND using Enterprise Manager, but I still
    get the same error!!!! The changes I do does not seem to affect the timeout time
    at all. It time's out within about 30seconds.

    Any ideas??

  6. #6
    Lively Member
    Join Date
    Jul 2002
    Location
    Mississippi
    Posts
    87
    Try setting it to "0" It should not time out at all.

    oConn.CommandTimeout = 0

    If that doesn't work try running your query in the query analizer and see how it works there. There may be something out of place in the query.

  7. #7
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,687
    As a matter of standard, we set all of our Timeouts to 300 (5 minutes) and it seems to be long enough for anything we do. You could try setting it to something outrageous if necessary.

    Also instead of setting the CommandTimeout on the Conneciton, set it on the Command object instead.... I know using the Command object adds a little bit more code, but I have found it to be benficial.
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  8. #8
    Addicted Member
    Join Date
    Aug 2000
    Location
    Pennsylvania, USA
    Posts
    168
    Two questions:

    1. How long is the SQL Server timeout?

    2. If it is longer than a minute or two, why is the SQL statement running so slowly? Could there be a large in clause that could be turned into a join or a subquery? Could your statement be returning a cartisian product instead of the intended data?
    Wydok

    "It would appear that we have reached the limits of what it is possible to achieve with computer technology, although one should be careful with such statements, as they tend to sound pretty silly in 5 years."

    -John Von Neumann ca. 1949

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width