You are currently browsing the tag archive for the 'Recordset.Move' tag.

Recordset.Move()

The Recordset.Move() technique was the first example I ever posted in this article. In an attempt to eliminate the need for heavy recordset objects, I decided to try the Move() method to skip the first n rows in the resultset to start at the first row for the page we are interested in.

<%
rstart = PerPage * Pagenum – (PerPage – 1)

dataSQL = “SELECT ArtistName, Title FROM SampleCDs WITH (NOLOCK)”

set rs = conn.execute(dataSQL)

if not rs.eof then

rs.move(rstart-1)

response.write “

for x = 1 to PerPage

if rs.eof then exit for

artist = rs(0)
title = rs(1)

if artist prevArtist then
prevArtist = artist
response.write “


response.write ”

rs.movenext
next

response.write “


response.write artist & “

else
response.write “

end if

response.write title & “


else
response.write “No rows found.”
response.end
end if
%>

This code can be found at:
http://databases.aspfaq.com/database/how-do-i-page-through-a-recordset.html

Pages

 

November 2009
M T W T F S S
« Oct    
 1
2345678
9101112131415
16171819202122
23242526272829
30  

RSS Example RSS Real Estate Feed

  • An error has occurred; the feed is probably down. Try again later.