Solved

How can I limit the number of records returned by ASP?

Posted on 1998-09-17
1
148 Views
Last Modified: 2013-12-25
I would like to limit the number of records returned on a single page by ASP like yahoo does. ie 30 records are returned by only 10 appear per page.  I am not sure how ASP saves the records I am not listing.
0
Comment
Question by:whitej8
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 28

Accepted Solution

by:
sybe earned 200 total points
ID: 1855098
There are several ways, you can use "bookmarks" in recordsets, but it can also be done much simpler.

For the first page
========================
intMax = 30
i = 0
Do While Not RS.EOF AND i <= intMax
  Response.write RS("yourdata") & "<br>"
  i = i + 1
RS.MoveNext
Loop
=======================


For all next pages, you can have a "startvalue", which you need to pass in a querystring/form.

Something like:

intStart = Request.Querystring("startvalue")
intMax = intStart + 30

RS.Move(intStart)

intMax = 30
i = intStart
Do While Not RS.EOF AND i <= intMax
  Response.write RS("yourdata") & "<br>"
  i = i + 1
RS.MoveNext
Loop


0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There’s a good reason for why it’s called a homepage – it closely resembles that of a physical house and the only real difference is that it’s online. Your website’s homepage is where people come to visit you. It’s the family room of your website wh…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
This tutorial demonstrates how to identify and create boundary or building outlines in Google Maps. In this example, I outline the boundaries of an enclosed skatepark within a community park.  Login to your Google Account, then  Google for "Google M…
The viewer will learn how to dynamically set the form action using jQuery.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question