[ Home ]

Cover of SQL Cover of SQL Tricks Cover of SQL Short Course Cover of SQL Visual QuickStart Guide 3rd Edition

Opening the Sample Database in Microsoft Access

To open books in Microsoft Access 2007 or later:

  1. In Access 2010 or later, choose File tab > Open.
    or
    In Access 2007, choose Microsoft Office Button > Open.
  2. Navigate to and select the .mdb file for your book:
    » books.mdb (SQL)
    » books_tricks.mdb (SQL Tricks)
    » books_short.mdb (SQL Short Course)
    » books_crash.mdb (SQL Crash Course for Beginners)
  3. Click Open.
  4. To inspect the tables, press F11 to show the Navigation pane. Click the menu at the top of the pane and choose Object Type, and then click the menu again and choose Tables (or All Access Objects).
  5. To run SQL statements against books, see “Microsoft Access” in Chapter 1 of SQL or SQL Tricks, or in Appendix B of SQL Short Course or SQL Crash Course for Beginners.

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

  1. Choose File > Open.
  2. Navigate to and select the .mdb file for your book:
    » books.mdb (SQL)
    » books_tricks.mdb (SQL Tricks)
    » books_short.mdb (SQL Short Course)
    » books_crash.mdb (SQL Crash Course for Beginners)
  3. Click Open.
  4. To inspect the tables, click Tables (below Objects) in the Database window.
  5. To run SQL statements against books, see “Microsoft Access” in Chapter 1 of SQL or SQL Tricks, or in Appendix B of SQL Short Course or SQL Crash Course for Beginners.

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, and 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.)