Click here to Skip to main content
15,867,453 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear All,

I need to find the record count of a recordset.

the RecordCount property of the recordset in VB6 is returning -1.

I am using ADODB connection.

Dim i as integer 
i = rs.RecordCount
//i is set as -1


I am executing a stored procedure.

Thanks & Regards

Varun Sareen
Posted
Updated 4-Aug-15 23:25pm
v4
Comments
OriginalGriff 5-Aug-15 2:12am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
So show us the code you are using to execute the procedure and get the count.
And show us the procedure as well!
Use the "Improve question" widget to edit your question and provide better information.
Varun Sareen 5-Aug-15 2:22am    
I have updated the question.
OriginalGriff 5-Aug-15 2:40am    
:sigh:

OriginalGriff wrote:
"Remember that we can't see your screen, access your HDD, or read your mind.
So show us the code you are using to execute the procedure and get the count.
And show us the procedure as well!"
Varun Sareen 5-Aug-15 5:33am    
I have tried everything in this link; but still not able to get the actual record count. In one of my page the same concept is giving the correct record count but when i am running in my current page it showing as -1.

Kindly refer the link:- http://www.geeksengine.com/article/recordcount-ado-recordset-vba.html

i have tried all what is specified in this link.
Maciej Los 5-Aug-15 4:01am    
What kind of recordset? ADODB.Recordset? Depends on method you create adodb.recordset the Count property may return -1.

1 solution

Please, read my comment to the question.


Here is an answer: RecordCount Property (ADO)[^]


MSDN wrote:
The property returns -1 when ADO cannot determine the number of records or if the provider or cursor type does not support RecordCount.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900