Creating Databases and Tables


As with any Windows program, there are a variety of ways to start Access. Unlike other Microsoft Office programs, such as Word and Excel, starting Access doesn t automatically open a blank work area where you can immediately start entering information. There are two reasons for this. The first is that each database has its own structure, and you can t enter information until you have defined that structure. The second is that Access automatically saves the changes you make to a database as you make them, so the database must be named and saved before you can enter information. In this topic, we ll show you how to create a new Access database, and then you ll create a table.

Information about  

Office Assistant, page 30

Starting Access and Creating a New Database

It s time to get started, so let s fire up Access and create the database for Tip Top Roofing:

  1. On the Windows taskbar, click the Start button, click All Programs , and then click Microsoft Access .

    After a few seconds, you see the screen shown here:

    click to expand
  2. If the Office Assistant pops up on your screen, click the Start using Microsoft Access option.

    When Access starts, the New File task pane is displayed on the right side of your screen. (If it is not automatically displayed, the Show at startup check box has been deselected. Simply click the New button to display the task pane.) You can use this task pane to open an existing database or to create a new Access database, either based on an existing file or template or from scratch.

  3. In the New area of the New File task pane, click Blank Database to open the File New Database dialog box, and then click the My Documents icon on the Places bar.

  4. Type Roofs in the File name text box, and click Create .

    The Database window appears, with the empty shell of your new database, as shown in this graphic:

    click to expand

    Before you can enter data or create a form or report, you must create a table to hold your data. The Tables object should already be selected on the Objects bar, which lists the possible components of a databases on the left side of the window. Clicking one of the icons on the Objects bar displays in the workspace to the right a list of possible actions for that object type. There are currently no tables listed on the right side of the window, but three methods listed for creating a new table are listed. We ll look at these next .

start sidebar
Selecting a file format

When you open a new database in Access 2002, it is automatically saved in the Access 2000 file format so that you can share it with people running the earlier version. This does not limit anything you will do while working through this course. For more information about Access file formats, refer to the Microsoft Office web site at http://office.microsoft.com.

end sidebar
 

Creating a Table by Using the Table Wizard

It might be possible to create one complex table that holds all the different kinds of information you want to store in your database, but doing so would be very inefficient, and the data would be very difficult to keep accurate. So most Access databases contain more than one table, each holding a specific type of information.

start sidebar
Installing Access features

If Access was installed on your computer as part of a Typical installation, certain features might not be active on your machine. In that case, you will be prompted to install the component from the Office installation CD-ROM.

end sidebar
 

Let s use the Table Wizard to create the first table, which will be used to store information about Tip Top Roofing s employees . Follow these steps:

  1. On the Database window s toolbar, click the New button.

    Access opens the New Table dialog box, shown in this graphic, in which you can specify how you want to create the table:

    click to expand

    You could double-click one of the options in the Database window (in this case, Create table by using wizard ) to create a new table, but we took this route to show you that you can also import a table created in another program or create a table that is linked to one in another file.

  2. Click Table Wizard , and then click OK .

    Installing Access features The wizard displays the first of a series of pages that lead you through the steps of creating your table s field structure, as shown in this graphic:

    click to expand
  3. In the Sample Tables list, click Employees .

    The Sample Fields list changes to reflect the kind of information usually stored in an employee database, with DepartmentName selected.

  4. Select EmployeeID , and then click the > button.

    The EmployeeID field name is added to the Fields in my new table list.

  5. Add the SocialSecurityNumber , FirstName , LastName , Address , City , PostalCode (ZIP code), HomePhone , and DateHired field names to the Fields in my new table list, either by clicking each name and then clicking the > button, or by double-clicking each name.

    If you add a field name by mistake, select it in the Fields in my new table list, and click the < button.

  6. Click the Next button.

    The wizard displays the page shown in this graphic:

    click to expand

    The name Access suggests for this table ”Employees ”is pretty logical, so you don t want to change the entry in the text box. However, you don t want Access to set the primary key , which is a field that distinguishes one record from another. When you enter field values in the table, no two entries in this field can be the same. In tables with keys, if you try to enter the same field value in two records, Access displays an error message and won t let you move to a new record until you change one of the duplicates.

  7. Click the No, I ll set the primary key option, and then click Next .

    Access displays the wizard dialog box shown in this graphic:

    click to expand

    You want to use the default EmployeeID field as the primary key, but instead of allowing Access to enter consecutive numbers, you want to enter the numbers yourself.

  8. Click the second option, and click Next .

    The wizard displays the page shown in this graphic:

    click to expand
  9. You want to enter data directly in the table, so click the Finish button without changing the default option.

    Access sets up the table with the field names you have specified and then displays the Table window in Datasheet view, shown in this graphic:

    click to expand
start sidebar
Ready-made business and personal tables

On the first Table Wizard page, you can choose from a variety of sample tables that are useful for business or personal databases. The business tables are listed by default. If you select the Personal option, Access displays a list of sample tables more appropriate for personal use. You might find some of these sample tables quite useful, so it s worth taking the time to explore the list.

end sidebar
 
start sidebar
Primary key

The primary key is a field containing a unique value that distinguishes one record from another. If you tell Access to set a primary key, and your table doesn t contain a field that is appropriate for a primary key, Access adds a new field and makes it the primary key. A consecutive number will be entered as that field s value for each new record you add.

end sidebar
 



Online Traning Solutions - Quick Course in Microsoft Office XP
Online Traning Solutions - Quick Course in Microsoft Office XP
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 116

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net