Article ID: 243394 - Last Review: January 25, 2007 - Revision: 4.5 HOWTO: Use MFC to Copy a DAO Recordset to Excel with AutomationThis article was previously published under Q243394 SUMMARY Microsoft Excel exposes the CopyFromRecordset method for a
Range object to copy the contents of a Data Access Objects (DAO) Recordset onto
a worksheet. This article demonstrates how you can use MFC DAO to build a
recordset that you can then copy to an Excel worksheet using automation.
MORE INFORMATION The following steps demonstrate how you can obtain a
recordset of all the records in the "Products" table in the sample Access
database Northwind.mdb and then automate Excel to copy the contents of that
recordset onto a worksheet. Although this example uses an Access database for
its recordset, you could use any database for which you can provide an ODBC
connection string. For details on using ODBC data sources with DAO, refer to
the MFC DAO online help. Sample Code
| Article Translations
|

Back to the top
