Chapter 2. Creating a New Database

Creating a New Database

Chapter 2 at a Glance

In this chapter you will learn how to:

  • Create a database structure the simple way.

  • Check the work of a wizard.

  • Create tables the simple way.

  • Refine how data is displayed.

  • Manipulate table columns and rows.

Creating the structure for a database is easy. But an empty database is no more useful than an empty Microsoft Office Word document or an empty Microsoft Office Excel 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 and your tools, 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 2003 takes a lot of the difficult and mundane work out of creating and customizing a database by providing wizards that you can use to create entire databases or individual tables, forms, queries, and other objects. It is generally easier to use a wizard to create something that is similar to what you need and then modify it than it is to create the same thing by hand.

In this chapter, you’ll create a couple of databases from scratch, first by using a wizard to rapidly create the structure for a sophisticated contact management database, complete with tables, queries, forms, and reports. After exploring this database and entering a few records to get an idea of what a wizard can provide in the way of a starting point, you will discard this database and start working on a simpler contacts database for The Garden Company. By the end of this chapter, you will have a GardenCo 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 in Chapter 2 Creating a New Database.

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-ROM" for more information.

Creating a Database Structure the Simple Way

Creating a Database Structure the Simple Way

A few years ago (the distant past in computer time), creating a database structure from scratch 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 had created it and entered data, making changes could be difficult. Wizards have changed this process. Committing yourself to a particular database structure is no longer the big decision it once was. By using the Database Wizard, you can create a dozen database applications in less time than it used to take to sketch the design of one on paper. Access wizards might not create exactly the database application you want, but they can quickly create something very close.

In this exercise, you will use the Database Wizard to create a new database structure. The new database, in this case, will contain the structure for a contact management database.

BE SURE TO start Access before beginning this exercise.

  1. If the New File task pane is not displayed, open it by clicking the New button on the Database toolbar.

    Creating a Database Structure the Simple Way
  2. In the Templates area of the task pane, click On my computer, and then click the Databases tab to display the available templates.

    Creating a Database Structure the Simple Way

    Tip

    The Database Wizard uses predefined templates to create fairly sophisticated database applications. In addition to the templates provided with Access, if you are connected to the Internet, you will find additional templates and other resources by following the link to "Templates on Microsoft.com" that is on the New File task pane.

  3. Double-click Contact Management.

    The File New Database dialog box appears so that you can provide a name for your new database and specify where to store it.

    Tip

    Tip

    The default folder for storing Access database files is My Documents. You can change this default to any other folder by clicking Options on the Tools menu when a database file is open, entering a new path in the Default database folder box on the General tab, and clicking OK.

  4. Navigate to the My DocumentsMicrosoft PressAccess 2003 SBSCreateNew folder, in the File name box, replace Contact Management1 with Contacts, and then click Create.

    Tip

    Naming conventions for Access database files follow those for Microsoft Windows files. A file name can contain up to 215 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 database file is .mdb.

    The database window is displayed, and then you see the first page of the Database Wizard, which tells you the type of information that will be stored in this database.

  5. This page requires no input from you, so click Next to move to the second page of the Database Wizard.

    Tip

    This page lists the three tables that will be included in the Contacts database. The box on the right lists the fields you might want to include in the table selected in the box on the left. Required fields have a check mark in their check boxes. Optional fields are italic. You can select the check box of an optional field to include it in the selected table.

  6. Click each table name, and browse through its list of fields, just to see what is available.

  7. Indicate that you want to include all the selected fields in the three tables by clicking Next to move to the next page of the wizard.

    The next page of the wizard appears, displaying a list of predefined styles that determine what the elements of the database will look like.

    Tip

    Whenever the Back button is active (not gray) at the bottom of a wizard’s page, you can click it to move back through previous pages and change your selections. If the Finish button is active, you can click it at any time to tell a wizard to do its job with no further input from you. Most of the options set by a wizard can be modified later, so clicking Finish does not mean that whatever the wizard creates is cast in stone.

  8. Click each of the styles to see what they look like.

  9. Click Blends, and click Next.

  10. Click each of the report styles to see what they look like.

  11. Click Bold, and click Next.

  12. Change the proposed database name to Contacts, leave the Yes, I’d like to include a picture check box cleared, and click Next.

    The Next button is unavailable on this page, indicating that this is the wizard’s last page. By default, the "Yes, start the database" check box is selected, and the "Display Help on using a database" check box is cleared.

  13. Leave the default settings as they are, and click Finish.

    The process of creating a database can take from several seconds to several minutes. While the wizard creates the database, an alert box tells you what is happening and how much of the process is complete. When the wizard finishes its work, it opens the newly created Contacts database with the switchboard displayed.

    Tip

    The switchboard opens, and the Contacts database window is minimized. (You can see its title bar in the lower left corner of the Access window.)

  14. At the right end of the Main Switchboard window’s title bar, click the Close button.

    Tip
  15. At the right end of the Contacts database window title bar, click the Close button to close the database.

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

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