473,564 Members | 2,759 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

recordcount in ADO

Have created recordset in ADO. I know there are a number of records in the
recordset since I can move through them.

However when I try to do a rst.RecordCount , I get "-1" as the count even if I
do a rst.MoveFirst and rst.MoveLast before the rst.RecordCount .

Any reason for this and any suggestions on correcting it?

Thanks for the help in advance.
Nov 12 '05 #1
2 2238
On 02 May 2004 17:57:12 GMT, mf***@aol.com (MFS 43) wrote:

Straight from the documentation:
The cursor type of the Recordset object affects whether the number of
records can be determined. 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.

-Tom.

Have created recordset in ADO. I know there are a number of records in the
recordset since I can move through them.

However when I try to do a rst.RecordCount , I get "-1" as the count even if I
do a rst.MoveFirst and rst.MoveLast before the rst.RecordCount .

Any reason for this and any suggestions on correcting it?

Thanks for the help in advance.


Nov 12 '05 #2
Thanks for the help.
Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
10392
by: Mark Watkins | last post by:
I know for a fact that in my database, I have three records under the users table. However when I execute this code: --------------BEGIN CODE---------------- Set objConn = Server.CreateObject("ADODB.Connection") objConn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=C:\Inetpub\wwwroot\spruce.mdb;" strQuery = "SELECT * FROM...
2
5066
by: Jeff Boyer | last post by:
Hello everyone, Can someone tell me why a ADO recordset.recordcount would return a -1? I have confirmed that it has records in it by writing some values to the screen. Why can't I count the number of records returned though? Please help, Jeff P.S. I am using VBScript for my code connecting to a SQL Server 2000 database
12
2956
by: scott | last post by:
In LISTING 2, I have a SPROC that returns a recordset and a recordcount in SQL QA. I can access the Recordset with no problem. How can I grab the Recordcount with ASP code at the same time I'm getting the Recordset? In QA, the RecordCount displays below the Recordset. The below USAGE code will display my SPROC results. USAGE: EXEC...
2
2070
by: nick_faye | last post by:
why does my recordcount returns the # of actual records + 1? btw, i am using ms access. i don't know what happened but at first, my table seems ok. the recordcount returns the correct # of records. but as i manipulate the table, (add, delete, etc) i get errors and when i checked my recordcount, it returns 1 more than the actual # of...
1
2397
by: JMCN | last post by:
hello- i have created a tabular form using records from a specific query. then users will filter out the specific data. the next step is to take the count of the current records (daily open items), then use the total number of daily open items to calculate the percentage to all open items for the month. my first question is how would i...
4
4878
by: don.fleming | last post by:
Hi folks: Am doing a VBA SQL Select stmt with multiple rows found and not getting RecordCount > 1. I've verified there are multiple rows found by copying my SQL stmt from Debug window and pasting it to a query - retrieves many rows. I need to program to handle many Rows in VBA. Suggestions much appreciated! Here is an excerpt of my VBA...
10
6714
by: Robert | last post by:
How do you get an accurate count of the number of records returned from a query when using linked tables. I have an access 2003 database as a front end to another access 2003 database that contains only tables. I have linked the tables for the front end to the back end database. I am trying to set the recordsource of a form to a query...
2
2158
by: rajvbprogramer | last post by:
here is my problem. i have two records. one containing 20 records and second containing 30 records. now i want the recordcount property to use and go to the 21 record. i m calculating the recordcount of both the record. now i m doing this a = rs.recordcount b = rs1.recordcount for x = b+1 to a
1
2472
by: qqmbers | last post by:
May be it will help someone. I faced the strange problem with RecordCount property of cloned Recordset within the Current event handler. The RecordCount value was correct every time I had diagnostic message boxes turned on or when I debugged the handler step by step. And these values became incorrect in normal mode (to be exact they became...
3
11061
by: sparks | last post by:
Is recordcount a little messed or what? For Each tdf In dbs.TableDefs If Left(tdf.Name, 3) = "tbl" Then Debug.Print tdf.Name Debug.Print tdf.RecordCount it prints the correct name but the RecordCount is off on 8 out of 30 tables. the only thing is all the correct ones don't have any records LOL
0
7888
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5213
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3626
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.