• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to find out how many records returned in recordSet

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have had a look at the documentation for RecordSet but cannot find a field or a method
which returns a count of the amount of records
returned from a query. Do i have to loop through the recordset to find out how many results were
returned?
Thanks
Kola
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kola wrote :
"Do i have to loop through the recordset to find out how many results were returned?"
yes, this is the only way i know to get this information. I'm not a SQL expert and dont know if
there's a SQL statement to bring this kind of information into the resultset, but it's a interesting subject of study.
 
Ranch Hand
Posts: 189
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For a scrollable RecordSet object, I resorted to:

Then you can do rs.first(); to "rewind" to the beginning.
You just have to keep in mind the offset: row numbering is "1" based, while array indices are zero based.
[ October 15, 2002: Message edited by: Philip Shanks ]
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic