PDA

View Full Version : limit number of items returned


gcapp
03-04-2003, 03:49 PM
Can someone help me?

I'm not sure of the code you would use to limit the number of records returned in a list and then to have a button that says "Get next 10" that will retrieve the next 10 records.

I have this code to search my table for businesses:

sqlbuslinks = "SELECT Name, Website, Description FROM Links ORDER BY Name"

Set rsBusLinks = Conn.Execute(sqlbuslinks)
response.write("<table border='0'>")

do while rsBusLinks.EOF=false
Response.Write("<tr valign='top'>")
Response.Write("<td><font face='arial' size='2' color='#000000'><b>" & (rsBusLinks("Name")) & "</b></font>")
Response.Write("<br><font face='arial' size='2'><i>" & "Website: " & "</i>" & "<a href=""javascript:open_window('http://" & rsBusLinks("Website") & "', 'popup', 'width=300,height=250,location=1,menubar=1,resizable=1,scrollbars=1,status=1,toolbar=1')"">" & rsBusLinks("Website") & "</a>")
Response.Write("<br><font face='arial' size='2'>" & (rsBusLinks("Description")) & "</font>")

response.write("<br>&nbsp;</td>")

response.write("</tr>")

rsBusLinks.MoveNext
loop
response.write("</table>")
rsBusLinks.Close

set rsBusLinks=nothing

Like I said, I'm not sure what code would go in there or where. I would appreciate it, if somone could point me in the right direction.

Thanks,
Gary

Spudhead
03-04-2003, 05:50 PM
what you want is "recordset paging" :)

Have a look here:

http://www.asp101.com/samples/db_paging.asp