SQL 3rd cover

SQL: Visual QuickStart Guide, Third Edition

Opening the Sample Database - Microsoft Access

To open books in Microsoft Access 2000, 2002, or 2003:

  1. Choose File > Open; navigate to and select books.mdb; then click Open.
  2. To inspect the tables, click Tables (below Objects) in the Database window.
  3. To run SQL statements against books, see "Microsoft Access" in Chapter 1.

To open books in Microsoft Access 2007 or later:

  1. In Access 2007, choose Microsoft Office Button > Open.

    or

    In Access 2010, choose File > Open.
  2. Navigate to and select books.mdb; then click Open.
  3. To inspect the tables, press F11 to show the Navigation pane. Click the menu at the top of the pane and choose Object Type; then click the menu again and choose Tables (or All Access Objects).
  4. To run SQL statements against books, see "Microsoft Access" in Chapter 1.

If you're running Access 97 or earlier, you won't be able to open books.mdb because it's an Access 2000-format file. To create the sample-database tables, use the Import Text wizard to import the CSV files included in the distribution. A CSV (comma-separated values) file is a text file in which each column value is separated by a comma from the next column's value and each row starts a new line. The first row contains column names. The CSV files for the various tables are named csv_authors.txt, csv_publishers.txt, and so on.

To import a CSV file as a table:

  1. In Access, open or create a database, or press F11 to switch to the Database window for the open database.
  2. Choose File > Get External Data > Import.
  3. In the Import dialog box, in the Files of Type box, select Text Files.
  4. Navigate to the drive and folder where the CSV file is located; then double-click its icon.
  5. Follow the onscreen instructions in the Import Text wizard. Click Advanced to create or use an import/export specification. (To cancel importing, press Ctrl+Break.)