Timeout expired (breakup pages)

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
Who is Participating?
Carl TawnConnect With a Mentor Systems and Integration DeveloperCommented:
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 ?
Carl TawnSystems and Integration DeveloperCommented:
It sounds like a Timeout retrieving the data from SQL Server rather than a problem with the page.
kwitcomAuthor Commented:
What if It is trying to look at too many records?
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Carl TawnSystems and Integration DeveloperCommented:
Possibly, or a network issue. Do you have any idea how many records it should be returning ?
kwitcomAuthor Commented:
maybe 100 or so out of maybe 10K.
kwitcomAuthor Commented:
yes..... I will try that.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.