|
-
April 13th, 1999, 07:56 PM
#1
"Select Count(*) ..." in ADO
How do I get the result of "Select Count(*) From MyTable"
in ADO? My program environment is VC6.0.
which ADO object (i.e. connection, command, etc) to use and
which method?
Thanks,
Vanessa Li
Vanessa Li
-
April 15th, 1999, 07:37 AM
#2
Re: "Select Count(*) ..." in ADO
If you want to use the GetCollect method of a recordset you can do this. Change the SQL to SELECT COUNT(*) FROM table AS total_count. Then use the getcollect method:
_variant_t Holder = MySet->GetCollect("total_count");
Holder.ival will have your value in it.
Bob
-
June 22nd, 1999, 01:57 AM
#3
Re: "Select Count(*) ..." in ADO
Good Day!
How should I declare the "total_count", should it be a field in my table?
or is it automatically created temporarily at runtime?
TIA
-
June 22nd, 1999, 10:11 AM
#4
Re: "Select Count(*) ..." in ADO
It is automaticly sreated in the returned recordset. If you go to MSQuery (or any other tool) and type the SQL in, you will see it listed as a column name.
bob
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|