Showing part of the data per page (exp page 1 of 1

Results 1 to 9 of 9

Thread: Showing part of the data per page (exp page 1 of 1

  1. #1
    Cable Guest

    Default Showing part of the data per page (exp page 1 of 1

    Let&#039s say you have a long result set. You only wish to show 50 rows per page. You have like 5000 rows returned. How can you only show 50 rows per page and allow the user to show the next or previous page?

  2. #2
    Join Date
    Dec 1969
    Posts
    569

    Default RE: Showing part of the data per page (exp page 1

    Perhaps this may help:<BR><BR>GetRows Method - ADO<BR>Retrieves multiple records of a Recordset into an array. <BR><BR>Applies To <BR><BR>Recordset <BR><BR>Syntax <BR><BR>array = recordset.GetRows( Rows, Start, Fields ) <BR><BR>Return Values <BR><BR>Returns a two-dimensional array. <BR><BR>Parameters <BR><BR>Rows Optional. A Long expression indicating the number of records to retrieve. Default is adGetRowsRest (-1). <BR><BR>Start Optional. A String or Variant that evaluates to the bookmark for the record from which the GetRows operation should begin. You can also use one of the following BookmarkEnum values: adBookmarkCurrent Start at the current record. <BR>adBookmarkFirst Start at the first record. <BR>adBookmarkLast Start at the last record. <BR><BR><BR><BR>Fields Optional. A Variant representing a single field name or ordinal position or an array of field names or ordinal position numbers. ADO returns only the data in these fields. <BR><BR>Remarks <BR><BR>Use the GetRows method to copy records from a Recordset into a two-dimensional array. The first subscript identifies the field and the second identifies the record number. The array variable is automatically dimensioned to the correct size when the GetRows method returns the data. <BR><BR>If you do not specify a value for the Rows argument, the GetRows method automatically retrieves all the records in the Recordset object. If you request more records than are available, GetRows returns only the number of available records. <BR><BR>If the Recordset object supports bookmarks, you can specify at which record the GetRows method should begin retrieving data by passing the value of that record&#039s Bookmark property. <BR><BR>If you want to restrict the fields the GetRows call returns, you can pass either a single field name/number or an array of field names/numbers in the Fields argument. <BR><BR>After you call GetRows, the next unread record becomes the current record, or the EOF property is set to True if there are no more records. <BR><BR>

  3. #3
    Cable Guest

    Default RE: Showing part of the data per page (exp page 1

    Thanks, but does this run the query will all the rows, and then just return the number I specify. Or does the query only run with the number of items I specify in the Getrows function? <BR><BR>What I am trying to say is will it bog down the server, or only have the query return a fraction of the rows based on the Getrows?

  4. #4
    Join Date
    Dec 1969
    Posts
    569

    Default RE: Showing part of the data per page (exp page 1

    This should only return the number you specify, then place the current cursor at the next row&#039s location


  5. #5
    Imar Spaanjaars Guest

    Default RE: Showing part of the data per page (exp page 1

    Take a look at the followong URL.<BR><BR>This might just be what you are looking for.<BR><BR>Imar<BR>

  6. #6
    Imar Spaanjaars Guest

    Default RE: Showing part of the data per page (exp page 1

    Take a look at the followong URL.<BR><BR>http://www.learnasp.com/learn/dbtablepaged.asp?view=joust<BR><BR>This might just be what you are looking for.<BR><BR><BR>Imar<BR>

  7. #7
    ActiveALLI Guest

    Default RE: Showing part of the data per page (exp page 1

    There is an excelent example on this here at the 4Guys site.<BR>take a look @ http://www.4guysfromrolla.com/webtech/121298-1.shtml

  8. #8
    Join Date
    Dec 1969
    Posts
    590

    Default RE: Showing part of the data per page (exp page 1

    The solutions so far referred to use a client-side cursor which is creating (so far as I can work out) the problem which I have come across spelt out in my question "asp slows down with html put into it".<BR>I used to page results using a server-side cursor(?) system. But this spits out the records in the order that they occur in the table. This does not give the flexibility required.<BR>I am no expert at these things so I am watching the threads carefully.<BR>Please post any solutions you find.<BR>Cheers

  9. #9
    Fred Guest

    Default RE: Showing part of the data per page (exp page 1

    You might want to check this URL<BR><BR>http://www.asp101.com/samples/index.asp<BR><BR>it has your solution.<BR><BR>It has most of the solutions you wil be looking for. Hope it helps<BR><BR>Fred

Posting Permissions

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