Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - ADO - Sintax - RecordCount
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

ADO - Sintax - RecordCount

 Post Reply Post Reply
Author
faca5 View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 30 July 2003
Location: Slovenia
Status: Offline
Points: 187
Post Options Post Options   Thanks (0) Thanks(0)   Quote faca5 Quote  Post ReplyReply Direct Link To This Post Topic: ADO - Sintax - RecordCount
    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
Back to Top
ub3rl337ch3ch View Drop Down
Senior Member
Senior Member
Avatar

Joined: 16 February 2005
Location: Australia
Status: Offline
Points: 341
Post Options Post Options   Thanks (0) Thanks(0)   Quote ub3rl337ch3ch Quote  Post ReplyReply Direct Link To This Post 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...
Back to Top
faca5 View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 30 July 2003
Location: Slovenia
Status: Offline
Points: 187
Post Options Post Options   Thanks (0) Thanks(0)   Quote faca5 Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
faca5 View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 30 July 2003
Location: Slovenia
Status: Offline
Points: 187
Post Options Post Options   Thanks (0) Thanks(0)   Quote faca5 Quote  Post ReplyReply Direct Link To This Post Posted: 21 February 2006 at 3:42pm
I use example which I found on (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!

Edited by faca5 - 21 February 2006 at 3:46pm
Back to Top
jeffdaro View Drop Down
Groupie
Groupie


Joined: 15 April 2005
Status: Offline
Points: 171
Post Options Post Options   Thanks (0) Thanks(0)   Quote jeffdaro Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
faca5 View Drop Down
Mod Builder Group
Mod Builder Group


Joined: 30 July 2003
Location: Slovenia
Status: Offline
Points: 187
Post Options Post Options   Thanks (0) Thanks(0)   Quote faca5 Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2006 at 3:40pm
Hello.
 
Yesterday I finaly resolved the problem. Thanks for all info.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.