Chapter 9. Creating a Database

Chapter at a Glance

Creating a Database

In this chapter, you will learn to:

Create a database from a template.

Create a table manually or by using a template.

Manipulate table columns and rows.

Creating the structure for a database is easy. But an empty database is no more useful than an empty document or worksheet. It is only when you fill, or populate, a database with data in tables that it starts to serve a purpose. As you add queries, forms, and reports, it becomes easier to use. If you customize it with a switchboard or custom categories and groups, it moves into the realm of being a database application.

Not every database has to be refined to the point that it can be classified as an application. Databases that only you or a few experienced database users will work with can remain fairly rough-hewn. But if you expect an administrative assistant to enter data or your company’s executives to generate their own reports, spending a little extra time in the beginning to create a solid database application will save a lot of work later. Otherwise, you’ll find yourself continually repairing damaged files or walking people through seemingly easy tasks.

Microsoft Office Access 2007 takes a lot of the difficult and mundane work out of creating and customizing a database by providing database applications in the form of templates that you modify and fill with your own information. Access 2007 also provides templates for common types of tables, and improved ways to import content from other applications to instantly create and populate tables. Using one of these methods to create something that is similar to what you need and then modifying your creation is generally easier than creating the same thing manually. If none of the templates or import methods match your needs, you can create tables manually—another process that has been improved in this version of Access.

In this chapter, you will create a database from a template, create a table manually, and create a single table from a template. Then, you’ll adjust the display of a data table to fit your needs. By the end of this chapter, you will have a database containing three tables that will serve as the foundation for many of the exercises in this book.

See Also

Do you need only a quick refresher on the topics in this chapter? See the Quick Reference entries at the beginning of this book..

Important

Important

Before you can use the practice files in this chapter, you need to install them from the book’s companion CD to their default location. See "Using the Book’s CD" at the beginning of this book for more information.

Troubleshooting

Graphics and operating system–related instructions in this book reflect the Windows Vista user interface. If your computer is running Microsoft Windows XP and you experience trouble following the instructions as written, please refer to the "Information for Readers Running Windows XP" section at the beginning of this book.

Creating a Database from a Template

A few years ago (the distant past in computer time), creating a database structure involved first analyzing your needs and then laying out the database design on paper. You would decide what information you needed to track and how to store it in the database. Creating the database structure could be a lot of work, and after you created it and entered data, making changes could be difficult. Templates have changed this process. Committing yourself to a particular database structure is no longer the big decision it once was. By using pre-packaged templates, you can create a dozen database applications in less time than it used to take to sketch the design of one on paper. Access templates might not create exactly the database application you want, but they can quickly create something very close that you can tweak to fit your needs.

In this exercise, you will open and explore a database application based on the Contacts template. This template is typical of those provided with Microsoft Office Access 2007, in that it looks nice and demonstrates a lot of the neat things you can do in a database, such as adding command buttons and embedded macros to link to other Office applications or Windows commands. Due to the complexity of these templates, you probably shouldn’t try to modify them until you are comfortable working with simpler tables and forms in Design view. There are no practice files for this exercise.

Note

BE SURE TO start Access before beginning this exercise.

  1. In the Template Categories list, click Local Templates.

    Tip

    When you are connected to the Internet, you can find additional templates and other resources in the From Office Online area of the Getting Started With Microsoft Office Access screen.

    Access displays a list of the templates that are available from the default template location (C:Program FilesMicrosoft OfficeTemplates1033Access).

    Tip

    When you point to a template icon, Access displays a description of the database in a pop-up window, called a ScreenTip. For more information about these templates, search Access Help for Guide to the Access 2007 templates.

  2. Click the Contacts template icon.

    A description of the template appears on the right side of the program window, along with a box in which you can assign a name to the database and a folder button to browse to the place you want to store the database.

    Tip
  3. In the File Name box, type Contacts Template, and note the default path.

    Tip

    Naming conventions for Access database files follow those for Microsoft Windows files. A file name, including its path, can contain up to 260 characters, including spaces, but creating a file name that long is not recommended. File names cannot contain the following characters: / : * ? " < > |.

    The extension for an Access 2007 database file is .accdb, instead of the .mdb extension used for previous versions. For information about the differences between the two formats, search Access Help for accdb.

  4. Click the Create button.

    Access briefly displays a progress bar, and then your new database opens.

    Tip
  5. If the Navigation Pane is closed, press to open it.

    Notice that the Navigation Pane displays a custom category named Contacts, and a custom group named Supporting Objects.

    Notice the commands above the column headers. These commands are examples of the embedded macros that make this an application rather than a database.

    Tip

    Access stores embedded macros as properties of the object to which they are attached. You can modify the design of the macro without worrying about other controls that might use the macro—each embedded macro is independent. Embedded macros are trusted because they are automatically prevented from performing certain potentially unsafe operations.

  6. Enter your own contact information into the first record.

  7. Explore the Contacts Template database on your own.

Note

CLOSE the Contacts Template database.

BE SURE TO delete the Contacts Template database from the default storage location if you don’t want to use it again.

Tip

Access creates new databases in your Documents folder. You can change the location as you create each database, or change the default save location. To do so, click the Microsoft Office Button, click Access Options, and then on the Personalize page, under Creating Databases, click the Browse button. In the Default Database Path dialog box, browse to the folder you want to select as the default database storage folder. Then click OK in each of the open dialog boxes.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.164.228