Article ID: 194005 - Last Review: March 14, 2005 - Revision: 4.3 HOWTO: Use ADO to Return a Summary RowThis article was previously published under Q194005 On This PageSUMMARY
The sample code in this article demonstrates how to extract the value of
summary rows using ADO. Summary rows are produced when you use a COMPUTE BY
clause with any row aggregate functions in a SQL statement. These summary
values appear as additional rows in the query results, unlike the aggregate
function results of a GROUP BY clause, which appear as new columns.
For example, the following query returns the summation for the "price" and "advance" columns in addition to the columns in the SELECT clause: MORE INFORMATION
The following code demonstrates this technique. This code uses the
NextRecordset method of the Recordset object to loop through the multiple
recordsets. The code uses the Pubs database supplied with Microsoft SQL
Server.
Sample CodeREFERENCES
For additional information on retrieving Multiple Recordsets, please see
the following article in the Microsoft Knowledge Base:
182290
(http://support.microsoft.com/kb/182290/EN-US/
)
HOWTO: Return Multiple Recordsets with Column Names and Values
APPLIES TO
| Article Translations
|

Back to the top
