paging using getrows

Results 1 to 4 of 4

Thread: paging using getrows

  1. #1
    Join Date
    Dec 1969

    Default paging using getrows

    Can you use ASP ADO paging function and still use the GETROWS function?<BR><BR>If i use GETROWS I get all the records and not just the ones which should be returned. <BR><BR>I have 250k records and only want to retreive 25 using the ADO paging function but i still would like to use RS.GETROWS - any ideas?? thx<BR>Arnold

  2. #2
    J Guest

    Default RE: paging using getrows

    I use this all the time...<BR>You need to move through your array in increments of 25..<BR>&#060;%<BR>For i = FirstRec To LastRec<BR>arrray(0, i), etc.<BR>Next<BR>%&#062;<BR>You will need to figure out the math and error trapping to make this work.

  3. #3
    J Guest

    Default Here is some code...

    If Request.Querystring("PAGE") = "" Then<BR>intPage = 1<BR>Else<BR>intPage = CInt(Request.Querystring("PAGE") )<BR>End If<BR><BR>intFirstRec = (intPage * 25) - 24<BR>intLastRec = (intPage * 25)<BR><BR>If Not rs.BOF And Not rs.EOF Then<BR>aryData = rs.GetRows<BR>Set rs = Nothing<BR><BR>intRecCount = UBound(aryData, 2) + 1 &#039get total records returned<BR> <BR>If intFirstRec &#062; intLastRec Then &#039error trapping<BR>intPage = 1<BR>End If<BR> <BR>If intLastRec &#062; intRecCount Then &#039 error trapping<BR> intLastRec = intRecCount<BR>End If<BR><BR>If intRecCount &#062; 25 Then &#039set up variables to move through array<BR> If intRecCount Mod 25 = 0 Then<BR> intTotalPages = intRecCount / 25<BR> Else <BR> intTotalPages = Int(intRecCount / 25) + 1<BR> End If<BR>Else<BR> intTotalPages = 1<BR>End If<BR> <BR>For i = (intFirstRec - 1) to (intLastRec - 1)<BR><BR>Next<BR>Erase aryData<BR>End If<BR>

  4. #4
    Join Date
    Dec 1969

    Default Check out this article

    There&#039s an article on 4Guys that illustrates paging with GetRows:<BR><BR><BR>Happy Programming!

Posting Permissions

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