error '80040e31' Timeout Expired but runs fast in Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mccrat
    New Member
    • May 2012
    • 2

    error '80040e31' Timeout Expired but runs fast in Query

    Hi All,
    I am at a loss....
    I am using asp with an MSSQL database back end. I have a very simple update statement in an ASP page that was working fine till just a few days ago but is now producing the error:

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

    I have searched and searched the web and have come across quite a few suggestions which I have tried but nothing has helped.

    Here is my update statement:
    Code:
    Const adOpenForwardOnly = 0
    Const adOpenStatic = 3
    Const adCmdTable = 2
    
    Dim conn
    Set conn = Server.CreateObject("ADODB.Connection")
    conn.Open "Provider=SQLOLEDB;Server=localhost;Database=My_db;User ID=my_id;Password=my_pw;Trusted_Connection=False;"
    conn.CommandTimeout=600
    
    set rs = Server.CreateObject("ADODB.Recordset")
    set rs.ActiveConnection = conn
    rs.CursorType = adOpenStatic
    
    sSQL = "UPDATE tblRecipient Set RSVPresponse='" & rsvpstr & "', RSVPdate='" & date & "' Where RecipientID=" & session("RecipientID")
    
    conn.Execute (sSQL)
    As you can see, my update statemet is very simple. When I do a response.write of the statement, copy and paste it into either ms Access or MS Server Management Studio it runs very fast successfully.

    Again, this was running just fine a few days ago and now it is timing out. Other statements run fine, its just this one that is timing out.

    Does anyone have any insite as to why this might be happening and what I can do to fix it???
    Last edited by PsychoCoder; Jun 6 '12, 05:11 AM. Reason: Added code tags
  • mccrat
    New Member
    • May 2012
    • 2

    #2
    Oh and in case some suggests this...my tables are indexed

    Comment

    • ck9663
      Recognized Expert Specialist
      • Jun 2007
      • 2878

      #3
      You might be having some lockout issue. Also, increase the time out setting of your web server.

      Good Luck!!!


      ~~ CK

      Comment

      Working...