How do I query an Excel worksheet as a PC file using Showcase Query?
In Excel97 or later, save the file as usual. In pre-Excel97, files must be saved as Microsoft Excel 4.0 worksheets. (Either through Excel or as a target file type in Query)
- Highlight the data in Excel that you want to query. This "named range" becomes the database.
- In M/S Excel click Insert->Name->Define; type in a name for the highlighted data then click Add.
- Repeat steps 1) and 2) as needed, each new name defines a "table" as seen in Query.
- Save Excel sheet. (Remember to save as an Excel 4.0 worksheet if the PC is running a version of Excel earlier than Excel97)
Open Microsoft ODBC Administrator: Use either 16-bit or 32-bit, depending on which version of Query and Report Writer was installed.
- Click ADD; choose Microsoft Excel Driver (*.xls)
- Type in the data source name and description
- Set database version to Excel97 (if using Excel97) or Excel 4.0 (if using a version earlier than Excel97)
- Click OK and CLOSE.
To run a Query:
- Within Query, click File\New. Choose the Excel Driver as the data source.
- Browse for Excel file you want to query.
- After selecting, note that the file name is in the first window and the workbookname in the second window. Add the TABLE/workbook name to the first window. This can be done by adding '\' to the path in the top window and either PASTE or TYPE the entry from the Table window.
AFTER YOU BROWSE: C:\Excel AFTER YOU COPY: C:\Excel\workbookname workbookname workbookname
- If the table window is blank, click the drop-down menu to see the tables that were defined in the first part of this resolution.
- Continue to set up the query as desired.
The copying of the workbook name to the path is very important. Browsing will not automatically pull it in. In pre-Excel97, you will find that when browsing to select a workbook, Query will enter the path in the Workbook window and add the workbook name to the Table window. This is not correct. Be sure that the workbook name is included to the path in the Workbook window, and then click on the table drop down to see tables for that workbook. These tables will be the names that were created in the first part of resolution.
Using this method multiple tables from one worksheet or even multiple tables from multiple workbooks can be chosen.
Remember: If another file is used, that workbook name must be added to the path.