Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Identify The Number Of Records In A Recordset

Status
Not open for further replies.

Skittle

ISP
Sep 10, 2002
1,528
US
Is there a way of telling how many records are in a record set without reading through the entire set or executing an SQL statement to return a single summary record with a count?


 
Open your recordset with an adOpenStatic cursorType and you can use the following...
Code:
Dim intCount, objRecordset

Set objRecordset = Server.CreateObject("ADODB.Recordset")
...etc...rest of code to open your recordset...

intCount = objRecordset.RecordCount
Tony
reddot.gif WIDTH=500 HEIGHT=2 VSPACE=3

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top