Import data from a database by using ODBC

If you want to do a quick, one-time import from a database such as Microsoft® Access, you can use an existing default data source. If you want to query the same database numerous times, you can create a reusable file data source that contains a shortcut to the database.

Import the data using a default data source

Because the following steps use a predefined machine data source to import data, this procedure is the quickest procedure. The following steps are for an Access database. If you import data from a different database application, the steps might vary slightly.

  1. Verify that the worksheet that you want to import data to is active. When the query is executed, Minitab puts the imported data to the right of any data that is already in the worksheet.
  2. Choose File > Query Database (ODBC).
  3. On the Machine Data Source tab, click the data source name that you want to use, such MS Access Database, then click OK.
  4. If prompted, enter your database login name and password.
  5. Browse to the folder that contains your database.
  6. Click the database so that it appears under Database Name, then click OK.
    Note

    If you are importing from a dBase file, you cannot select the file here. Click OK, then select the dBase file from the Available tables drop-down list. If OK is not available, select the folder in the Folders list, then click OK. The dBase file name must be 8 characters or fewer, not including the file extension.

  7. From the Available tables drop-down list, select the table that you want to query.
  8. Use the arrow button to move the fields that you want to import to Selected fields.
  9. To import a subset of data, click Use rows, specify a condition, then click OK.

Create a reusable file data source to import data

If you want to query the same database many times, you can create a file data source that contains a shortcut to the database so that you don't have to browse to the database every time. The following steps are for an Access database. If you import data from a different database application, the steps might vary slightly.

  1. Verify that the worksheet to which you are importing data is active. When the query is executed, Minitab puts the imported data to the right of any data that is already in the worksheet.
  2. Choose File > Query Database (ODBC).
  3. On the File Data Source tab, click New.
  4. Select the driver for which you want to set up a data source, such as Microsoft® Access driver (*.mdb).
    Note

    If the driver that you need is not in the list, you must install the driver before you can complete these steps.

  5. Click Next.
  6. Enter a name for the link (for example, testACCESS).
  7. Click Next, then click Finish.
  8. If you have an older release of Access, you might need to specify the system database. Select Database, click System Database, then browse to and select the system database (for example, System.mdw).
  9. Under Database, click Select.
  10. Browse to and select the database that you want to query so that it appears under Database Name, then click OK.
  11. If prompted, enter your database login name and password.
  12. Click OK in each dialog box until the Query Database (ODBC) dialog box appears.
  13. From the Available tables drop-down list, select the table that you want to query.
  14. Use the arrow button to move the fields that you want to import to Selected fields.
  15. To import a subset of data, click Use rows, specify a condition, then click OK in each dialog.
  16. The next time that you want to import data from this database, choose File > Query Database (ODBC), select the file data source that you defined, then follow steps 12 to 15.