[ASP] Size of Record Set

Started by
2 comments, last by Tron3k 18 years, 10 months ago
Say I query a MS SQL DB for a record set and it return however many records. What I want to know is, how do I return the size of the record set? I tried using UBound(), but I guess the record set object doesn't count as an array. Help? Thanks!
-Conrad
Advertisement
Use the RecordCount property
I have a valid record set returned, I even print out the results, but for that RecordCount command I keep getting -1. Any reason? Any other way to do this?
-Conrad
RecordCount Property

Use the RecordCount property to find out how many records are in a Recordset object. The property returns -1 when ADO cannot determine the number of records or if the provider or cursor type does not support RecordCount. Reading the RecordCount property on a closed Recordset causes an error.

You might need to actually iterate through all the records to find out how many there are, if this property is not supported. Or there might be a way to get a different cursor type.
“[The clergy] believe that any portion of power confided to me, will be exerted in opposition to their schemes. And they believe rightly: for I have sworn upon the altar of God, eternal hostility against every form of tyranny over the mind of man” - Thomas Jefferson

This topic is closed to new replies.

Advertisement