473,326 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Select Count(*) question

In VB6 I have this code for returning data to a recordset via 2
Selects:

1. Select * from MyTable (98 rows of data are here)
rs.recordcount returns "98"

2. Select count(*) from MyTable
rs.recordcount returns a value of 1 - which is fine
Here, rs!results returns "98" - this is very helpful in other parts of
my app.

Thinking I could just copy the code from VB6 to Access 2003, I did
that.
But in my Access app, I found I cannot use "rs!results". (also tried
"rs.results" which did not show up in the intellisense)
My select count yields 1 row here too, but I need to return the results
of that count (that shows that 98 rows were counted) like I did in the
VB6 app.

Is there any way in Access to return the results of a select count?

Thanks.

Feb 28 '06 #1
1 3008
If this is an array, the value should be in the array. No? So...rs(0)

James Igoe
Access/Excel VBA Developer
http://code.comparative-advantage.com/

Feb 28 '06 #2

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

Similar topics

9
by: atse | last post by:
Hi, My table in the database may contain duplicate records, which means except the primary key (auto_increment) field is unique, all or almost of all the fields are with the same content. How...
7
by: andy vandenberghe | last post by:
Hello everybody, i have the following table (agltransact), in which 2 fields are relevant: ex_inv_ref account 15 1512 15 6040 16 1512 16 1512 16 ...
7
by: JP Belanger | last post by:
I have a question on select count(), which may betray my lack of database knowledge. Here goes. I have java code driving a transaction which goes like this: select count(*) from table ...
18
by: war_wheelan | last post by:
I am very new to Transact-SQL programming and don't have a programming background and was hoping that someone could point me in the right direction. I have a SELECT statement SELECT FIXID,...
4
by: Justin Koivisto | last post by:
OK, out of my element here once again... I want a query (or something I can use as a record source for a report) to do the following: * look in 2 tables (one field each) to find all entered...
4
by: rdemyan via AccessMonster.com | last post by:
I have the following SQL statement in code that is set to the RowSource of a combobox. The combobox has two columns. SELECT '(ALL)' As Site, '' As , 0 As SortFirst FROM GROUP BY SITE_COMPLEX...
22
by: MP | last post by:
vb6,ado,mdb,win2k i pass the sql string to the .Execute method on the open connection to Table_Name(const) db table fwiw (the connection opened via class wrapper:) msConnString = "Data Source="...
0
by: djflow | last post by:
Hi! II was wondering if you can help me with SQL query.. Below 7 separated select query works fine(only when they are retrieved separately) But I want to combined them together and so that i...
6
markrawlingson
by: markrawlingson | last post by:
Hopefully someone can help me out with this, it's driving me nuts... I have two tables - We'll call them table1 and table2. Table1 holds event information, and table2 holds user registration data...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.