paging in sql server

Results 1 to 2 of 2

Thread: paging in sql server

  1. #1
    jon Guest

    Default paging in sql server

    this is the code i am using to page through the results of a contact database<BR><BR><BR>if request.form("Page")="" then <BR> PageNo=1<BR>Else<BR> PageNo=request.form("Page")<BR>End If<BR>&#039;if first page is displayed, then brief summary is displayed<BR>&#039;new code end<BR><BR>set rs=Server.CreateObject("adodb.Recordset")<BR>&#039 ; Set up connection string<BR><BR>sqlstmt= "SELECT * from tblcontact"<BR><BR> sqlstmt, mydsn, 3,3<BR><BR>rs.movefirst<BR><BR>response.write rs("notes")<BR><BR><BR>totalrecs=rs.recordcount<BR ><BR>rs.pagesize=100<BR><BR>totalpages=cInt(rs.pag ecount)<BR>&#039;figures out how many pages for the entire record set<BR><BR>rs.absolutepage=PageNo<BR><BR>however it doesnt like the above line (rs.absolutepage)<BR>the recordcount is returning -1 when there are 2000 records in the database.<BR><BR>any ideas - running on sql 7 database<BR><BR><BR><BR>

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: paging in sql server

    use this example as a templete<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts