Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003
    Glasgow, UK

    Unanswered: ASP + SQL 2K - Timeout Expired on One Specific Table


    I am pulling my hair out here. I have been doing ASP/SQL websites since 1996 but I have come across a problem which I cannot seem find any resolution to.

    Why on earth would I get a timeout with the following:

    <% Option Explicit
    Dim objConn, objRs
    Set objConn = Server.CreateObject("ADODB.Connection")
    objConn.Open Application("Database_ConnectionString")
    Set objRs = objConn.Execute("SELECT * FROM dbo.tbl2WaySessions")
    If Not objRs.EOF Then
    	Do While Not objRs.EOF
    		Response.Write "<p>" & objRs.Fields(0).Value
    End If
    Set objConn = Nothing %>
    This is a page from a site with hundreds of visitors a day. I have just created a new table and a different page that uses it and I have come across this problem. I started to work backwards and ended up with the simple code above which I just cannot believe gives the following error:

    Microsoft OLE DB Provider for SQL Server error '80040e31' 
    Timeout expired 
    /debug/isuniquesessionid.asp, line 6
    What is most annoying is that this problem only occurs on my production server and not my staging server. They are both at the same MDAC and SQL SP levels.

    There are no records in the table at the moment, so for this first attempt I should be getting an EOF anyway.

    As previously mentioned, there are about 40 tables in this database and about 100 ASPs, all using exactly the same kind of syntax etc. with tables created in exactly the same way.

    When I look at the command in SQL Profiler I see no errors or warnings and definately less detail than with a statement that executes successfully. Normally the text will be repeated about four times with different event classes. This statement it only appears once as SQL:BatchCompleted.

    Any help with this would be very much appreciated.

    David Morgan

  2. #2
    Join Date
    Sep 2003
    A thought...Does your connect string differ?
    E.g. MyCon.Open("provider=msolap; Datasource=LocalHost; Initial Catalog=FoodMart 2000; Connect Timeout=120")

Posting Permissions

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