Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old October 21st, 2004, 05:31 AM
Registered User
Join Date: Sep 2003
Location: , , United Kingdom.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default counting record numbers in a loop


I have a loop going through a recordset with a condition. If the condition is fullfilled then the record is displayed... and when the recordset has been fully paged iot stops so i am left with a list of values.... this all works fine.

The values field name is "email"

WHat i need to do now is to be able to count the records that have been displayed, or the count the records that have fullfilled the condition....... how can this be done please?

Reply With Quote
  #2 (permalink)  
Old October 21st, 2004, 11:22 AM
Friend of Wrox
Join Date: Jul 2003
Location: , , United Kingdom.
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post

Hey sniffer,

You could just create a variable & increment it each time a record meets your requirements.



Reply With Quote
  #3 (permalink)  
Old October 21st, 2004, 11:49 AM
Friend of Wrox
Join Date: Jun 2003
Location: Bangalore, KA, India.
Posts: 2,480
Thanks: 0
Thanked 1 Time in 1 Post

Hi Sniffer,

Is that in anyways related to your other post Can 2 recordsets be joined or searched?

If so, As Chris suggested, make the changes mentioned in RED below.

Dim iCnt
iCnt = 0
While NOT rs_A55report.EOF
    While NOT rs_special.EOF
        If rs_A55report("Email")= rs_special("Email_Address") then
            'Display the data from rs_A55report
            iCnt = iCnt + 1
        End If
Response.write "Number of Records that matched the criteria : " & iCnt
Hope that helps.

- Vijay G
Strive for Perfection
Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
problem to fetch record using while loop Manoah Classic ASP Professional 9 July 31st, 2008 10:04 PM
XSLT loop counting and breaking. warhero XSLT 1 July 3rd, 2007 03:02 PM
Counting amount of record rtr1900 Classic ASP Databases 2 December 1st, 2005 08:08 AM
record counting keyvanjan Classic ASP Databases 0 June 30th, 2005 01:20 AM
Counting unique record dlamarche Access 5 March 22nd, 2005 08:51 AM

All times are GMT -4. The time now is 05:00 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.