This code will take data from the Northwind database and write it to an Excel spreadsheet. Code can be modified to do more complex reports, but the basics are included here.
Assumes
You have a System DSN entry set up pointing the the Northwind database called nwind. You also need to set up references to Microsoft Excel 8.0 Object Library and Microsoft ActiveX Data Objects 2.1 Library.