dividing search resaults into seperate pages

Results 1 to 2 of 2

Thread: dividing search resaults into seperate pages

  1. #1
    a Guest

    Default dividing search resaults into seperate pages

    How do i make search resaults not show up all in one page but devided like 15 resaults per page and then the user is able to move on to the next page in order to see the rest and so on?<BR>Thanks alot for your help!

  2. #2
    Join Date
    Dec 1969

    Default RE: dividing search resaults into seperate pages

    all right, lets do this:<BR><BR>&#060;%<BR>page=request.querystring(" page")<BR>if isnull("page") or page="" then<BR>page=1<BR>else<BR>page=page<BR>end if<BR>search=replace(request.form("search"),"&#039 ","&#039&#039")<BR>set conn=server.createobject("adodb.connection")<BR>co nn.open "DSN=mydsn"<BR>set rs=server.createobject("adodb.recordset")<BR>rs.cu rsorlocation=3<BR>rs.cachesize=15<BR>rs.activeconn ection=conn<BR>rs.open "select * from table where ((field like &#039%" & search & _<BR>")) order by autonumberfield desc"<BR>rs.movefirst<BR>rs.pagesize=15<BR>pages=r s.pagecount<BR>rs.absolutepage=page<BR>count=0<BR> do while not rs.eof and count&#060;rs.pagesize<BR>field1=rs.field("field1" )<BR>field2=rs.field("field2")<BR>response.write "Record Number: " & count+1 & "<BR>Field 1: " & _<BR>field1 & "<BR>Field 2: " & field2 & "<BR>"<BR>rs.movenext<BR>loop<BR>conn.close<BR>rs. close<BR>set conn=nothing<BR>set rs=nothing<BR>%&#062;<BR><BR>hope this helps!!

Posting Permissions

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