Page 234 - Excel Workbook for Dummies
P. 234

23_798452 ch16.qxp  3/13/06  7:40 PM  Page 217
                                                                      Chapter 16: Building and Maintaining Data Lists  217
                                         you select a different driver). Here you select the name of the Access database to
                                         query.
                                     5. Select the Select button to open the Select Database dialog box and then use its
                                         folder hierarchy in the Directories list box on the right to find the Northwind.mdb
                                         file. First, find the My Practice Spreadsheets folder and double-click its folder icon
                                         to open it. Next, find the Chapter 16 folder and then double-click its folder icon to
                                         open it. Finally, click the Northwind.mdb filename in the Database Name text box
                                         before you select OK.
                                         As soon as the Select Database dialog box closes, you are returned to the ODBC
                                         Microsoft Access Setup dialog box, where the path to the Northwind.mdb data-
                                         base file now appears.
                                     6. Select the OK button to close the ODBC Microsoft Access Setup dialog box to
                                         close it and return to the Create New Data Source dialog box.
                                         Here, you could select the name of a data table in the Northwind database to use
                                         by default in the query. Also, you would select the Save My User ID and Password
                                         in the Data Source Definition check box if the particular database (such as the
                                         corporate database) you’re querying requires you to use a login and password in
                                         order to access its data.
                                     7. Select the OK button to complete the Product Query data source definition by
                                         closing the Create New Data Source dialog box and returning to the Choose Data
                                         Source dialog box.

                                         The name of the data source definition, Product Query, which you just defined,
                                         now appears selected at the bottom of the Databases list box in the Choose Data
                                         Source dialog box.
                                     8. Verify that the Product Query data source is selected in the Databases list box
                                         as well as the Use the Query to Create/Edit Query check box at the bottom of the
                                         Choose Data Source dialog box before you select OK.
                                         As soon as you select OK, the Query Wizard — Choose Columns dialog box
                                         appears, where you specify the fields whose data you want to extract into the
                                         Excel worksheet during the database query.
                                     9. Click the expand button (with the plus sign) in front of the tables named Products
                                         and Categories in the Available Tables and Columns list box on the left.
                                         As soon as you click its expand buttons, all the fields in the Categories and
                                         Products data tables are displayed in Available Tables and Columns list box in
                                         the order in which they appear in the table.
                                    10. Move the following fields in the designated table from the Available Tables and
                                         Columns list box over to the Columns in Your Query list box in the following
                                         order by clicking each of the field names followed by the > button:
                                            • ProductID in Products
                                            • ProductName in Products
                                            • UnitPrice in Products
                                            • UnitsInStock in Products
                                            • UnitsOnOrder in Products
                                            • CategoryName in Categories
                                            • Description in Categories
                                         The list of fields in the Columns in Your Query list box from which to extract
                                         data during the external query should now match the one shown in Figure 16-3.
   229   230   231   232   233   234   235   236   237   238   239