You are on page 1of 88

¢ 

Lab 1
˜ 
 





| 
       |      !     " 
0

¢bjectives

1. Plan and create a database.


2. Create and save a table structure.
3. Define field names, data types, field
properties, and primary key.
4. Change views.

| 
       |      !     " 
0

¢bjectives continued

6. Enter and edit data in Datasheet view


and Data Entry.
7. Insert a picture.
8. Adjust column widths.
9. Use the Best fit feature.

| 
       |      !     " 
0

¢bjectives continued

10. Add records.


11. Delete records.
12. Preview and print a table.
13. Close and open a table and database.

| 
       |      !     " 
0

¢utline
 Database  Entering and editing table
Database data
Table Datasheet view
Queries Entering data
MS access Editing data
 Creating a table Inserting a picture
Record, Field Navigation
Field name  Printing a table
Data types
Field properties
Primary key field
0

Concept Preview

‡ Database ‡ Field Property


‡ ¢bject ‡ Primary Key
‡ Field Name ‡ Graphic
‡ Data Type ‡ Column Width

| 
       |      !     " 
0

¢utline

‡ Introducing Access 2003


± Starting Access
± Exploring the Access Window
‡ Creating a New Database
± Planning and Designing a Database
± Creating and Naming the Database

| 
       |      !     " 
0

¢utline continued
‡ Creating a Table
± Defining Field Names
± Defining Data Types
± Defining Field Properties
± Entering a Field Description

| 
       |      !     " 
0

¢utline continued

‡ Creating a Table continued


± Defining a Primary Key Field
± Defining Date formats
± Defining Additional Fields
± Editing Field Definitions
± Saving the Table Structure

| 
       |      !     " 
0 0

¢utline continued
‡ Entering and Editing Table Data
± Using Table Datasheet View
± Entering Data in a Datasheet View
± Editing Data
± Inserting a Picture
± Navigating a Datasheet

| 
       |      !     " 
0 00

¢utline continued
‡ Changing a Column Width
± Resizing a Column
± Using Best Fit
‡ Adding Records in Data Entry
‡ Deleting Records

| 
       |      !     " 
0 0

¢utline continued

‡ Previewing and Printing a Table


± Previewing the Table
± Changing the Page ¢rientation
± Printing a Selected Page
‡ Closing and ¢pening a Table and
Database

| 
       |      !     " 
0 0

¢utline continued

‡ Exiting Access
‡ Key Terms
‡ FAQs
‡ Discussion Questions

| 
       |      !     " 
0 0

¢utline
 Database  Entering and editing table
Database data
Table Datasheet view
Queries Entering data
MS access Editing data
 Creating a table Inserting a picture
Record, Field Navigation
Field name  Printing a table
Data types
Field properties
Primary key field
0 0

Concept 1
G   
‡ 


 ± ¢rganized collection of related
information
‡ 
 ± Vertical columns & horizontal rows
where information is stored
G   
‡   (a row in a table)
± A group of related pieces of information about
one person, place, or thing
‡ 
± (a column in a table, or an entry in a record)
± Smallest unit of information
| 
       |      !     " 
0 0

Example

‡ Suppose we are a parts distributor.


‡ We have a list of   that we work with,
a list of 
 that we sell.
‡ For each supplier, we know their contact
address, what parts they supply, and at what
price.
‡ We also know the specification of each part.
‡ We want to create a database for this.

—   

| 
       |      !     " 
0 0

Database

    
ë  ë 
 ë  
100 Parts Universe Twintown, CA
105 Discount parts Pittsburgh, PA
  
112 Power Parts Kentmont, ¢K ë  
  

« « « 100 33333 $0.95


100 44444 $1.45

 100 55555 $5.00
    105 33333 $0.50

 

 
  105 44444 $0.95
33333 Bolt 1 in 112 55555 $15.95
44444 Screw 2 in « « «
55555 Pipe 2 feet
« « «

—   

| 
       |      !     " 
0 0

Queries

‡ List all the suppliers.


‡ List all the suppliers in CA.
‡ List all the suppliers who supply bolts.
‡ List all the suppliers who supply bolts for less
than $1.00.
‡ Count the number of parts supplied by Parts
Universe.
‡ Give the average price of screw from the
suppliers in PA.
—   

| 
       |      !     " 
0 0

Introducing Access 2003


‡ Starting Access
± New file task pane is displayed
± Start by first creating a new database or
opening an existing one
‡ The Access Window features
± Database toolbar
± Taskpane
± Workspace
± Status bar
| 
       |      !     " 
0 

The Access Window




p 

   
G   



  

| 
       |      !     " 
0 0

Creating a New Database

‡ Plan
‡ Design
‡ Develop
‡ Implement
‡ Review

| 
       |      !     " 
0 

Planning and Designing a


Database
‡ Analyze current record-keeping system
‡ What forms are currently used for data
entry?
‡ What reports are needed?
‡ What data will be in the tables?
‡ How will the tables be related?

| 
       |      !     " 
0 

Creating and Naming the


Database File
‡ File New Database dialog box
± Database file name
‡ Default is 0
‡ Extension is .
‡ Replace with new name
± Location of file
‡ Default is   folder
‡ Database window
± ¢pens in workspace
± Name of database displayed in title bar
| 
       |      !     " 
0 

Creating and Naming the


Database
  G  

G  


 
  

| 
       |      !     " 
0 

¢utline
 Database  Entering and editing table
Database data
Table Datasheet view
Queries Entering data
MS access Editing data
 Creating a table Inserting a picture
Record, Field Navigation
Field name  Printing a table
Data types
Field properties
Primary key field
0 

¢utline
 Database  Entering and editing table
Database data
Table Datasheet view
Queries Entering data
MS access Editing data
 Creating a table Inserting a picture
Record, Field Navigation
Field name  Printing a table
Data types
Field properties
Primary key field
0 

Concept 2
¢

¢ 

 Stores data

  Finds and displays selected data

  View, add, and update data in


tables
 Analyzes and prints data in a
specific layout
| 
       |      !     " 
0 

Database

    
ë  ë 
 ë  
100 Parts Universe Twintown, CA
105 Discount parts Pittsburgh, PA
  
112 Power Parts Kentmont, ¢K ë  
  

« « « 100 33333 $0.95


100 44444 $1.45

 100 55555 $5.00
    105 33333 $0.50

 

 
  105 44444 $0.95
33333 Bolt 1 in 112 55555 $15.95
44444 Screw 2 in « « «
55555 Pipe 2 feet
« « «

—   

| 
       |      !     " 
0 

Creating a Table
‡ The table object is the basic unit of a
database
‡ Must be created first before other
objects
‡ Cannot open more than one database
file at a time

| 
       |      !     " 
0 

Three Ways to Create a Table

0 G  
 G
   

| 
       |      !     " 
0 0

Design View

 G

 




 





| 
       |      !     " 
0 

Concept 3

 

‡ Used to identify data stored in the field


‡ Up to 64 characters long
‡ Cannot start name
with a space
‡ Examples:
± Last name
± First name
± Address

| 
       |      !     " 
0

Database

    
ë  ë 
 ë  
100 Parts Universe Twintown, CA
105 Discount parts Pittsburgh, PA
  
112 Power Parts Kentmont, ¢K ë  
  

« « « 100 33333 $0.95


100 44444 $1.45

 100 55555 $5.00
    105 33333 $0.50

 

 
  105 44444 $0.95
33333 Bolt 1 in 112 55555 $15.95
44444 Screw 2 in « « «
55555 Pipe 2 feet
« « «

—   

| 
       |      !     " 
0 

Defining Field Names

˜  


 !



G 
 # 
 

"   


 # 

| 
       |      !     " 
0 

Defining Data Types

G 
 # 

G  # 

| 
       |      !     " 
0 

Concept 4
G  # 

‡ Data type defines the type of data field


will contain
‡ Used to ensure right kind of data is
entered
‡ Important to choose appropriate data
type

| 
       |      !     " 
0 

Data Types

Text AutoNumber
Memo Yes/No
Number ¢LE ¢bject
Date/Time Hyperlink
Currency Lookup Wizard

| 
       |      !     " 
0 

Concept 5

   #

‡ Characteristic that
defines a field
‡ Each data type has
a set of properties
‡ Enhances the way
table works

| 
       |      !     " 
0 

Field Properties

‡ Field Size ‡ Validation Rule


‡ Format ‡ Validation Text
‡ Input Mask ‡ Required
‡ Caption ‡ Allow Zero Length
‡ Default Value ‡ Indexed

| 
       |      !     " 
0 

Entering a Field Description



  

"     

| 
       |      !     " 
0 0

Concept 6
  #$#

‡ A field that uniquely identifies each record


‡ Most tables have a primary key
‡ Key data MUST be  
‡ Prevents duplicate records
‡ Used to control sorting order
‡ Used to create a link between tables

| 
       |      !     " 
0 

Defining a Primary Key

G
   # #

%
 
   # #

G  & 


 

| 
       |      !     " 
0 

Defining Date Format

G '
 # 
  

    

   

| 
       |      !     " 
0 

Defining a Field

‡ 

± Supplier Name
‡ 

 
± Text
‡   
± 30 Characters
±«
‡ ( 
 )
| 
       |      !     " 
0 

Defining Additional Fields

00



| 
       |      !     " 
0 

More on Creating Tables

‡ Editing field
definitions
‡ Saving the table
structure

| 
       |      !     " 
0 

¢utline
 Database  Entering and editing table
Database data
Table Datasheet view
Queries Entering data
MS access Editing data
 Creating a table Inserting a picture
Record, Field Navigation
Field name  Printing a table
Data types
Field properties
Primary key field
0 

¢utline
 Database  Entering and editing table
Database data
Table Datasheet view
Queries Entering data
MS access Editing data
 Creating a table Inserting a picture
Record, Field Navigation
Field name  Printing a table
Data types
Field properties
Primary key field
0 

ENTERING AND EDITING


TABLE DATA
Views
Ú!  
 "! Used to create a table, form,
query, or report


# "! Provides a row-and-column view
of data
Form view Displays records in a form

Preview Displays data as it will appear


when printed
| 
       |      !     " 
0 

Using Table Datasheet View


‡ Datasheet
‡ Field selector
‡ Record selector  
 

‡ Current record
‡ Record number G      

indicator
‡ Navigation button 
 
 

| 
       |      !     " 
0 0

Entering Data in a Datasheet


View

%

   
 
  
 


% #  #& 

| 
       |      !     " 
0 

Datasheet View

‡ Entering data
± Should be accurate and consistent
± Typed exactly as you want it to appear
‡ Editing data
± Position insertion point in field
± Use ESC to cancel changes

| 
       |      !     " 
0 

Concept 7
p 

We are pleased
to announce
the grand
opening of
om·s Geli


G


˜ 

| 
       |      !     " 
0 

Graphics
‡ Graphic
‡ Drawing object
‡ Picture
‡ Bound object
‡ Unbound object

| 
       |      !     " 
0 

Inserting a Picture
˜   

% (

| 
       |      !     " 
0 

Preview
˜ 
 (&

 &



| 
       |      !     " 
0 

¢pening Inserted ¢bject

  



   

| 
       |      !     " 
0 

Navigating a Datasheet
Key Voice Movement
Right arrow key Tab or Right Next field
or Tab
Left arrow key or Shift tab or left Previous field
Shift +Tab
Downward arrow Down Current field in
key next record
Upward arrow Up Current field in
key previous field
Home Home First field in record
End End Last field in record
| 
       |      !     " 
0 

Changing a Column Width

˜
 

  #  #

˜
 
 


| 
       |      !     " 
0 

Concept 8
˜ 


‡ Size of a field column


‡ Affects amount of data you can see
‡ Default can display 15.6667 characters
‡ Can adjust width for appearance
‡ Use Best Fit
What is the difference between column
width and field size?

| 
       |      !     " 
0 0

Resizing a Column

˜
  



  
#
  #
G 


| 
       |      !     " 
0 

Using Best Fit

ï


| 
       |      !     " 
0 

Adding Records in Data Entry

ï( 
 



  



 


 #

| 
       |      !     " 
0 

Adding Records in Data Entry


 
  #

 # #


| 
       |      !     " 
0 

Deleting Records

G



 (  #


 


| 
       |      !     " 
0 

¢utline
 Database  Entering and editing table
Database data
Table Datasheet view
Queries Entering data
MS access Editing data
 Creating a table Inserting a picture
Record, Field Navigation
Field name  Printing a table
Data types
Field properties
Primary key field
0 

¢utline
 Database  Entering and editing table
Database data
Table Datasheet view
Queries Entering data
MS access Editing data
 Creating a table Inserting a picture
Record, Field Navigation
Field name  Printing a table
Data types
Field properties
Primary key field
0 

Previewing And Printing A


Table
‡ Preview table to save time
± Adjust magnification to best fit
± Can view multiple pages
‡ Page orientation
± Portrait
± Landscape
‡ Print table
± Use default settings
± Use Print command to change settings

| 
       |      !     " 
0 

Previewing the Table

  &

   


0! 

 

   

| 
       |      !     " 
0 

More on Preview

G  # 

| 
       |      !     " 
0 0

Changing the Page


¢rientation

   


 
 
 

| 
       |      !     " 
0 

Print ¢ptions
¢   
 Prints the entire
document

 Prints pages you
specify by typing page
numbers in the textbox
ë   Prints selected records
only

| 
       |      !     " 
0 

Printing a
Selected page
)
 

@    

| 
       |      !     " 
0 

Closing And ¢pening A Table


& Database
‡ Close table and save any layout changes
‡ Close database
‡ Click ¢PEN to open existing database file
‡ Select name of table to open

| 
       |      !     " 
0 

Closing a Table

     

| 
       |      !     " 
0 

Closing the Database

 


 
&  

@ #ï


| 
       |      !     " 
0 

¢pening a Database

)
 


ï 

| 
       |      !     " 
0 

¢pening a Table

¢ 
 

  

| 
       |      !     " 
0 

Exiting Access

‡ Click ´ in the upper right corner of the Access


window
‡ Menu equivalent is ile/xit

| 
       |      !     " 
0 

¢utline
 Database  Entering and editing table
Database data
Table Datasheet view
Queries Entering data
MS access Editing data
 Creating a table Inserting a picture
Record, Field Navigation
Field name  Printing a table
Data types
Field properties
Primary key field
0 0

Key Terms

‡ active window ‡ database


‡ Best Fit ‡ Database toolbar
‡ bound object ‡ drawing object
‡ cell ‡ datasheet
‡ clip art ‡ data type
‡ column width ‡ field
‡ current field ‡ field name
‡ current record ‡ field property

| 
       |      !     " 
0 

Key Terms continued

‡ field selector ‡ portrait


‡ field size ‡ primary key
‡ graphic ‡ record
‡ landscape ‡ record number
‡ navigation buttons indicator
‡ object ‡ record selector
‡ orientation ‡ relational database
‡ picture ‡ table

| 
       |      !     " 
0 

Key Terms continued

‡ Unbound object ‡ Wizard


‡ view ‡ workspace

| 
       |      !     " 
0 

FAQs
1. What is a relational database?
2. What is the difference between a table
and a file?
3. Does a database contain one table or
several tables?

| 
       |      !     " 
0 

FAQs
4. The My Document folder has several
files called db1, db2, db3, etc. What
are these?
5. What other Access objects are in a
database besides tables?
6. What is a primary key?
7. I am ready to enter my data into
Access. What do I need to do first?

| 
       |      !     " 
0 

FAQs
8. How can I get the state code of my
state to be entered automatically in a
field?
9. I want to enter dates using the MM-
DD-YY format. Is there an easy way
to do this?
10. I forgot a field in my table and now I
want it positioned in the middle of the
table. How can I do this?
| 
       |      !     " 
0 

Discussion Questions
1. Discuss several uses you may have
for a relational database. Explain the
steps you would follow to create your
first table.
2. Discuss why it is important to plan a
database before creating it. How can
proper planning save you time later?
3. Discuss the difference between Edit
mode and Navigation mode.
| 
       |      !     " 
0 

Discussion Questions
4. Design view and Datasheet view are
two views in Access. Discuss when it
would be appropriate to use each of
these views.
5. Discuss why it is important to choose
the correct data type for a field. What
may happen to the data if you change
the data type?

| 
       |      !     "