The information in this article applies to:
SUMMARY
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.
If you create a recordset based on this SQL statement, and if you loop through the recordset, you can only see the columns specified in the SELECT clause. This is because ADO returns the results of a query with a COMPUTE statement as multiple recordsets. To get the summary rows, you must loop through each recordset from the multiple recordsets. 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 Code
REFERENCES
For additional information on retrieving Multiple Recordsets, please see
the following article in the Microsoft Knowledge Base:
Q182290 HOWTO: Return Multiple Recordsets with Column Names and Values Additional query words:
Keywords : kberrmsg kbADO kbASP kbDatabase kbScript kbGrpASP kbGrpMDAC kbDSupport kbRDS210SP2 kbCodeSnippet kbiis400 kbiis500 |
Last Reviewed: December 8, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |