Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page through Records

Status
Not open for further replies.

jmatte

Programmer
Joined
Jan 31, 2001
Messages
6
Location
US
I have a search results page which I populate by calling a stored procedure in SQL Server 2000 and saving the results to a recordset.

I iterate through the recordset placing each field in the appropriate column and row where I also take the id field and href to a matching image which appears on the same row with the corresponding record.

My code is this:

'If the recordset is full then display column headers
<%If rsItem.eof = false then %>

<table class=&quot;medium&quot;>
<tr>
<td><p>Click on the images below to see details</p>
</td>
</tr>
<tr>
<td><b> Image</b></td>
<td><b> Item Number</b></td>
<td><b> Description</b></td>
</tr>

<%'Write each item to the page

While Not rsItem.EOF%>


<%'Get the matching image for the record %>

<td><div><a href=&quot;../dynamic/main.asp?PN=
<%=rsItem.Fields.Item(2)%>&UID=<% =UID%>
&AUF1=4&AUF2=5&AUF3=6&AUF4=7<imgsrc=
&quot;/images/search/p
<% =rsItem.Fields.Item(0)%>B.gif&quot;>
</a>
</div>
</td>
<%'Display Item Number%>

<td><div><% =rsItem.Fields.Item(2)%></div></td>

<%'Display Item Description%>
<td ><% =rsItem.Fields.Item(1)%></td>

</tr>

<%rsItem.Movenext
Wend %>


How can I page through the recordset showing only a set amount on each page?

Is there a way to save the recordset to an object that will hold the results even as the next page is called?

I've been researching using an Array but I'm not sure how to display the data like I have it now.

Please help if you can. :)

J
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top