The information in this article applies to:
SUMMARY
When you use Microsoft Excel, you can access data from an external database
in one of three ways:
MORE INFORMATIONUsing the Microsoft Query Add-In to Return Data to a WorksheetWith the Microsoft Query add-in (Xlquery.xla) you can bring data directly from an external data source into Microsoft Excel. This add-in uses Dynamic Data Exchange (DDE) with Microsoft Query to allow you to interactively create a query for your external data. You can even the record a macro that retrieves external data using this add-in. To use this add-in, click Add- Ins on the Tools menu and select the MS Query Add-In check box.When you install the Microsoft Query add-in, the Get External Data command is added to the Data menu. To return data to Microsoft Excel:
To modify a query that is saved with your worksheet, do any of the following:
Click the Show Topics button, select the topic, and click Go To. For more information about using Microsoft Query to retrieve data from external databases, click the Index tab in Microsoft Excel 7.0 Help, type the following text
double-click the selected text and then double-click the "Retrieving data from external databases" topic. Creating a PivotTable That Uses External DataThe Microsoft Query add-in also allows you to create a PivotTable with an external data source. The PivotTable allows you to summarize external data on your worksheet. To use external data in a PivotTable:
To update the query results in the PivotTable, select any cell in the PivotTable and click Refresh Data on the Data menu. To modify the query that is used in the PivotTable, select any cell in the PivotTable and click the PivotTable command on the Data menu. Click the Back button in Step 3 of the PivotTable Wizard and then click the Get Data button in Step 2. Using the ODBC Add-in in a MacroYou can use the ODBC add-in (Xlodbc.xla) to work with external data programmatically. This add-in allows you to execute queries on the data source, return information about the database, and return data to the worksheet. This add-in does not use Microsoft Query to access the data. The add-in strictly uses the ODBC (open database connectivity) API (application programming interface) to interact with the ODBC Manager and the external database.To use this add-in a macro, you must reference it from the module sheet. To reference the add-in, activate your module sheet, click References on the Data menu, and select XLODBC.XLA. For additional information, please see the following article(s) in the Microsoft Knowledge Base: Q124218 : XL5: Macro Examples Using XLODBC Functions Using DAO (Data Access Object) in a Macro (Microsoft Excel 7.0 only)With Microsoft Excel version 7.0, DAO is the preferred method for working with external data in a macro. In many cases, DAO has much higher performance than the ODBC add-in, provides more functionality and is easier to use. Using DAO, you can access Jet databases, ISAM (indexed sequential access method) databases, and ODBC databases. DAO, like the XLODBC.XLA add- in, does not use Microsoft Query to access the external data.To use DAO, you must reference it from the Module sheet. To reference the object library, activate your module sheet, click References on the Data menu, and select Microsoft DAO 3.0 Object Library. For more information about DAO, click the Index tab in Microsoft Excel Help, type the following text
double-click the selected text and then double-click "Data Access Objects Overview." Additional query words: 5.00a 5.00c pivot table
Keywords : kbole kbtool xlquery |
Last Reviewed: April 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |