Displaying records in sets of 5

Results 1 to 3 of 3

Thread: Displaying records in sets of 5

  1. #1
    Join Date
    Dec 1969
    Posts
    14

    Default Displaying records in sets of 5

    Is there a way to only get the first 5 records or records 5-10 to display on a page without getting all the records? Or will I have to do rs.movenext until I get to the start record?<BR><BR>while current &#060;> startrec rs.movenext WEND<BR><BR>while current &#060;> endrec<BR> do_stuff<BR>WEND<BR>

  2. #2
    Join Date
    Dec 1969
    Posts
    511

    Default RE: Displaying records in sets of 5

    By changing the cursor type to static (3) or forwardonly (4) you can move directly to any record in the record set. I do this like so :<BR> &#060;snip><BR> &#039Set connection to Database<BR> Set DataConn = Server.CreateObject("ADODB.Connection")<BR> Set AccidentRS = Server.CreateObject("ADODB.Recordset")<BR> <BR> AccidentRS.cursortype= 3<BR> <BR> &#039Open DB<BR> DataConn.Open "DSN=incident"<BR> &#060;snip><BR><BR>Now you can use the Move and MoveNext Methods to navigate around the record set. So you could do:<BR><BR>MyRS.Move 10<BR>for i = 1 to 5 do<BR> &#039display record<BR> MyRS.MoveNext<BR>next<BR><BR>Pete

  3. #3
    Kams Guest

    Default RE: Displaying records in sets of 5

    You can page through the records in a recordset using the following properties of recordet:<BR>rs.pagesize - # of recs in each page<BR>rs.absolutepage - current page#<BR>rs.pagecount - # of pages the recordset was divided into depending on the pagesize you&#039ve given

Posting Permissions

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