Timeout expired (breakup pages)

Posted on 2006-05-08
Last Modified: 2012-06-27
Error I am getting:

Microsoft OLE DB Provider for SQL Server error '80004005'
Timeout expired
/z1/table3.asp, line 54

Ok I am looking for code to break-up pages to it does not time-out.

Current Code is:
Set conn = Server.CreateObject("ADODB.Connection")
Conn.Open "Provider=SQLOLEDB; Data Source=localhost; Initial Catalog=001; User ID=xxxxx; Password=xxxxxx"
Set ObjRs = Server.CreateObject("ADODB.Recordset")

dim dia, strID, strSQL, Conn, rs, strSQL2, strSQL3, strSQL4, strSQL5, rs2, rs3, rs4, rs5, ordno
dia = Date()
strSQL = "SELECT * FROM sfordfil_sql WHERE compl_dt is NULL ORDER BY ord_no"
set rs = Conn.Execute(strSQL)
<table border="1" width="546" id="table1" height="63">
          <td height="31" width="109">Shop Order #</td>
          <td height="31" width="102">Short Model #</td>
          <td height="31" width="102">Item Description</td>
          <td height="31" width="102">Start Date</td>
          <td height="31" width="72">Print</td>
<% While Not rs.EOF %>
          <td width="109"><%= rs("ord_no") %></td>
          <td width="102"><%= rs("item_no") %></td>
          <td width="102"><%= rs("item_desc_1") %></td>
          <td width="102"><%= rs("start_dt") %></td>
            <td width="72">
     strSQL2 = "SELECT * FROM labels WHERE sf_ord = " & rs("ord_no")
     set rs2 = Conn.Execute(strSQL2)
if rs2.BOF AND rs2.EOF then%>
<a href="printme.asp?ordno=<%= rs("ord_no") %>">Print First</a>
<a href="printme.asp?ordno=<%= rs("ord_no") %>">Print again</a>
<%End If%>
<% rs.MoveNext %>
<% Wend %>
set conn = nothing
Question by:kwitcom
    LVL 52

    Expert Comment

    by:Carl Tawn
    It sounds like a Timeout retrieving the data from SQL Server rather than a problem with the page.

    Author Comment

    What if It is trying to look at too many records?
    LVL 52

    Expert Comment

    by:Carl Tawn
    Possibly, or a network issue. Do you have any idea how many records it should be returning ?

    Author Comment

    maybe 100 or so out of maybe 10K.
    LVL 52

    Accepted Solution

    That should be ok. The error message definatley indicates a problem retrieving the data from the SQL Server.

    Can you retrieve data from other tables or other pages ? Do you have access to the SQL Server/Enterprise Manager so you can test the query directly against the DB ?

    Author Comment

    yes..... I will try that.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Suggested Solutions

    Title # Comments Views Activity
    Dynamic? Dropdown Box 29 65
    Read XML Response From ASP Classic 9 48
    syntax error on ASP ? 6 34
    Group by correlation 4 41
    I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
    Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    779 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

    14 Experts available now in Live!

    Get 1:1 Help Now