• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 790
  • Last Modified:

adodb.recordset recordcount return -1

hi
my record set did not return recount value always return -1

here is some code
set rs = new adodb.recordset
set rs = objhcon.execute (sSQL)
msgbox rs.recordcount

Open in new window

0
Luhana
Asked:
Luhana
1 Solution
 
DhaestCommented:
Why does RecordCount return as -1?
(Recordcount is not supported with the default forward-only cursor. If you open a recordset in the following manner, you will have access to recordcount:)

http://classicasp.aspfaq.com/general/why-does-recordcount-return-as-1.html
0
 
Ryan ChongCommented:
you can also try like this:

set rs = new adodb.recordset
rs.CursorLocation = adUseClient
rs.open sSQL, objhcon, 1, 1
msgbox rs.recordcount

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now