?
Solved

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

Posted on 1998-09-17
1
Medium Priority
?
149 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 800 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

770 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