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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recordcount issue

Status
Not open for further replies.

frosty7700

Programmer
Aug 10, 2001
95
US
Every time I use recordcount it is returning -1, even though I can verify that there are indeed records. I even place a response.write with the recordcount in the line directly following the recordset creation...still, it's -1. Any ideas?
 
Pretty much.....Try specifying your cusor type. Since your default cursor type is Foward Only you will always get a return of -1. Make it either an OpenKeyset or Dynamic and you will see different results......
 
....
or you can simply count the records via SQL:
SELECT COUNT(*) AS REC_COUNT FROM TABLE
if the REC_COUNT is 0 then you have no records.
 
this is a cursorType issue.

Unless you specify a cursorType that supports forward and backward movement (which does not come by default), .recordCount will always return -1

There is a FAQ in this forum that goes over the different types of cursorTypes. Might make a good read.

FAQ333-618

:)
paul
penny.gif
penny.gif
 
By default the cursor location will be server side and U will always get -1 as recordcount. use cursor location as "aduseClient" you will get the correct result.

Hope this will help u...

srinu...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top