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
Printable View
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
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
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
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