Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Active Server Pages (ASP)
Expertise: Beginner
Jan 10, 2000

Limiting Search Results

Question:
When my clients enter searching criteria, I want to limit the number of results. For example, if the number of results is over 100, I want the user to have to go back and try the search again. How can I do this?

Answer:
An easy way is to do a SELECT COUNT(*) FROM ... WHERE ... so that you get the number of records instead of the records. If you get too many, display that fact to the user. If not, do the other query. An alternative is to do the whole query, but only let the user see 100 results—keep a counter going while you're dumping the records out.

DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date