Print Page | Close Window

ADO - Sintax - RecordCount

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=18440
Printed Date: 29 March 2026 at 4:24pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: ADO - Sintax - RecordCount
Posted By: faca5
Subject: ADO - Sintax - RecordCount
Date Posted: 19 February 2006 at 4:08pm
Hello.
 
I don't understand all. When I use Access database I get the correct number of row. When I use SQL database I get -1?
 
exp

i=rs.RecordCount
Response.Write(i)
 
I get exp. 10
 
How I can resolve my problem!?
 
Something about RecordCount
http://www.w3schools.com/ado/prop_rs_recordcount.asp - http://www.w3schools.com/ado/prop_rs_recordcount.asp


-------------
http://www.studiofaca.com/" rel="nofollow - StudioFACA Portal :: http://www.renes.si/" rel="nofollow - Nepremičnine



Replies:
Posted By: ub3rl337ch3ch
Date Posted: 19 February 2006 at 10:07pm

Note: This property will return -1 for a forward-only cursor; the actual count for a static or keyset cursor; and -1 or the actual count for a dynamic cursor.

make sure you've opened the rs with the appropriate cursor...


Posted By: faca5
Date Posted: 21 February 2006 at 3:28pm
Hello.
 
It's stil open!
Set rs = Server.CreateObject("ADODB.RecordSet")
rs ...
 
On Access database work perfectly. When I change only the database to SQL Server it doesn't work. All important commands are the some.


-------------
http://www.studiofaca.com/" rel="nofollow - StudioFACA Portal :: http://www.renes.si/" rel="nofollow - Nepremičnine


Posted By: faca5
Date Posted: 21 February 2006 at 3:42pm
I use example which I found on ( http://www.w3schools.com/ado/prop_rs_recordcount.asp - http://www.w3schools.com/ado/prop_rs_recordcount.asp ), and It return -1. When I add 1,2 on (rs.Open sql,conn, 1, 2) finali I get number of row. But when I change database It isn't work. The some problem!

-------------
http://www.studiofaca.com/" rel="nofollow - StudioFACA Portal :: http://www.renes.si/" rel="nofollow - Nepremičnine


Posted By: jeffdaro
Date Posted: 22 February 2006 at 3:08pm
The problem you are having has to do with client side vs. server side cursors.

http://www.adopenstatic.com/faq/recordcounterror.asp - http://www.adopenstatic.com/faq/recordcounterror.asp


Posted By: faca5
Date Posted: 22 February 2006 at 3:40pm
Hello.
 
Yesterday I finaly resolved the problem. Thanks for all info.


-------------
http://www.studiofaca.com/" rel="nofollow - StudioFACA Portal :: http://www.renes.si/" rel="nofollow - Nepremičnine



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net