Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP
Dear Friends,
 
In a interview, they have asked me a question.
If Recordset.count returns -1 value then what it means.
I dont know the answer for this. Kindly any one provide me a solution.
Posted 11-Oct-12 6:03am
Comments
Wes Aday at 11-Oct-12 11:09am
   
There is no "solution". -1 generally means no rows were affected.
Wes Aday at 11-Oct-12 11:15am
   
If you are talking about a DAO Recordset, then a -1 means that you have not moved the pointer so it does not know how many records are contained yet. AFAIK, been a long time since I saw one.
Maciej Los at 11-Oct-12 13:24pm
   
My virtual 5!

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Recordset.RecordCount property (ADO)
The RecordCount property will return -1 for a forward-only cursor; the actual count for a static or keyset cursor; and either -1 or the actual count for a dynamic cursor, depending on the data source.

 
More at:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms676701%28v=vs.85%29.aspx[^]
http://msdn.microsoft.com/en-us/library/office/ff821452.aspx[^]
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 304
1 Maciej Los 285
2 Sergey Alexandrovich Kryukov 230
3 Shweta N Mishra 186
4 Aajmot Sk 153
0 OriginalGriff 7,660
1 Sergey Alexandrovich Kryukov 7,072
2 DamithSL 5,604
3 Manas Bhardwaj 4,986
4 Maciej Los 4,760


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 11 Oct 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100