Solved

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

Posted on 1998-09-17
1
142 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
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
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 count occurrences of each item in an array.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now