0% found this document useful (0 votes)
112 views

Office Access 2003: Creating A Database

Office Access 2003 Lab 1 Creating a database. McGraw-Hill Technology Education (c) 2004 by the McGraw-hill Companies, Inc. All rights reserved. Objectives 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. 10. Add records. 11. Delete records. 12. Preview and print a table. 13. Close and open a table and database.

Uploaded by

n3ilgalv3z
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
112 views

Office Access 2003: Creating A Database

Office Access 2003 Lab 1 Creating a database. McGraw-Hill Technology Education (c) 2004 by the McGraw-hill Companies, Inc. All rights reserved. Objectives 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. 10. Add records. 11. Delete records. 12. Preview and print a table. 13. Close and open a table and database.

Uploaded by

n3ilgalv3z
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 78

Office Access 2003

Lab 1
Creating a Database

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-5

Outline
 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
1-6

Concept Preview
• Database • Field Property
• Object • Primary Key
• Field Name • Graphic
• Data Type • Column Width

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-14

Outline
 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
1-15

Concept 1
Database
• Database – Organized collection of related
information
• Table – Vertical columns & horizontal rows
where information is stored
DATABASE
• Record (a row in a table)
– A group of related pieces of information about
one person, place, or thing
• Field
– (a column in a table, or an entry in a record)
– Smallest unit of information
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-16

Example
• Suppose we are a parts distributor.
• We have a list of suppliers that we work with,
a list of parts 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.

© 2007 P. Uthaisombut
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-17

Database
Supplier Table record
Supplier ID Supplier Name Supplier Address
100 Parts Universe Twintown, CA
105 Discount parts Pittsburgh, PA
Supply Table
112 Power Parts Kentmont, OK Supplier ID Part ID Price

… … … 100 33333 $0.95


100 44444 $1.45
field 100 55555 $5.00
Part Table 105 33333 $0.50
Part ID Part Name Part dimension 105 44444 $0.95
33333 Bolt 1 in 112 55555 $15.95
44444 Screw 2 in … … …
55555 Pipe 2 feet
… … …

© 2007 P. Uthaisombut
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-18

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.
© 2007 P. Uthaisombut
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-19

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
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-20

The Access Window


Title bar
Menu bar
Getting started
task pane
Database toolbar

Mouse Pointer

Workspace

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-21

Creating a New Database

• Plan
• Design
• Develop
• Implement
• Review

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-22

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?

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-23

Creating and Naming the


Database File
• File New Database dialog box
– Database file name
• Default is db1
• Extension is .mdb
• Replace with new name
– Location of file
• Default is My Documents folder
• Database window
– Opens in workspace
– Name of database displayed in title bar
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-24

Creating and Naming the


Database
Places bar Default location

Default name is selected Restricts to database files

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-25

Outline
 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
1-26

Outline
 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
1-27

Concept 2
Object

Object Use
Table Stores data

Query Finds and displays selected data

Form View, add, and update data in


tables
Report Analyzes and prints data in a
specific layout
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-28

Database
Supplier Table record
Supplier ID Supplier Name Supplier Address
100 Parts Universe Twintown, CA
105 Discount parts Pittsburgh, PA
Supply Table
112 Power Parts Kentmont, OK Supplier ID Part ID Price

… … … 100 33333 $0.95


100 44444 $1.45
field 100 55555 $5.00
Part Table 105 33333 $0.50
Part ID Part Name Part dimension 105 44444 $0.95
33333 Bolt 1 in 112 55555 $15.95
44444 Screw 2 in … … …
55555 Pipe 2 feet
… … …

© 2007 P. Uthaisombut
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-29

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

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-30

Three Ways to Create a Table

1. Datasheet View
2. Design View
3. Table Wizard

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-31

Design View

Table Design Toolbar

Two open windows

Field definition grid used to define fields

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-32

Concept 3
Field Name

• 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

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-33

Database
Supplier Table record
Supplier ID Supplier Name Supplier Address
100 Parts Universe Twintown, CA
105 Discount parts Pittsburgh, PA
Supply Table
112 Power Parts Kentmont, OK Supplier ID Part ID Price

… … … 100 33333 $0.95


100 44444 $1.45
field 100 55555 $5.00
Part Table 105 33333 $0.50
Part ID Part Name Part dimension 105 44444 $0.95
33333 Bolt 1 in 112 55555 $15.95
44444 Screw 2 in … … …
55555 Pipe 2 feet
… … …

© 2007 P. Uthaisombut
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-34

Defining Field Names

Click to open drop-down list

Field Default data type


name

Help information on data types

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-35

Defining Data Types

Default data type

Data types

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-36

Concept 4
Data Type

• 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

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-37

Data Types

Text AutoNumber
Memo Yes/No
Number OLE Object
Date/Time Hyperlink
Currency Lookup Wizard

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-38

Concept 5
Field Property

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

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-39

Field Properties

• Field Size • Validation Rule


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

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-40

Entering a Field Description

Field description

Help information on current task

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-41

Concept 6
Primary Key

• A field that uniquely identifies each record


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

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-42

Defining a Primary Key

Defines field as primary key

Indicates field as primary key

Duplicate values in field not allowed

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-43

Defining Date Format

Date/time data type


formats

Format sample

Format name

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-44

Defining a Field

• Field Name
– Supplier Name
• Data type
– Text
• Field property
– 30 Characters
–…
• (Primary key)
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-45

Defining Additional Fields

11 fields defined

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-46

More on Creating Tables


• Editing field
definitions
• Saving the table
structure

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-47

Outline
 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
1-48

Outline
 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
1-49

ENTERING AND EDITING


TABLE DATA
Views
View Purpose
Design view Used to create a table, form,
query, or report
Datasheet view Provides a row-and-column view
of data
Form view Displays records in a form

Preview Displays data as it will appear


when printed
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-50

Using Table Datasheet View


• Datasheet
• Field selector
• Record selector Table datasheet
toolbar
• Current record
• Record number Datasheet containing one blank record
indicator
• Navigation button Record number indicator

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-51

Entering Data in a Datasheet


View

Identifies end of table or where


new record can be entered or edited

Informs you that entry is not valid

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-52

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

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-53

Concept 7
Graphic

We are pleased
to announce
the grand
opening of
Tom’s Deli

Photograph
Drawing Object

Clipart

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-54

Graphics
• Graphic
• Drawing object
• Picture
• Bound object
• Unbound object

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-55

Inserting a Picture
Create a new object

Insert existing object

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-56

Preview
Changes dialog box view

Preview of
selected file

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-57

Opening Inserted Object

Picture opened in
graphics program

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-58

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
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-59

Changing a Column Width

Column width too small


to display entire entry

Column width larger


than needs to be

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-60

Concept 8
Column Width

• 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?

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-61

Resizing a Column

Column width increased


and field entries are
fully displayed Drag to size column width

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-62

Using Best Fit

All fields selected

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-63

Adding Records in Data Entry

All existing records are hidden

Number of records
entered in data
entry

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-64

Adding Records in Data Entry

Records are displayed in


primary key order

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-65

Deleting Records

Deletes selected
record

Message box asks you


to confirm deletion

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-66

Outline
 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
1-67

Outline
 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
1-68

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

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-69

Previewing the Table

Print Preview toolbar

Table name and date


1-inch margin

Mouse pointer

Page number in footer

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-70

More on Preview

Displays two pages

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-71

Changing the Page


Orientation

Page orientation
changed to landscape

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-72

Print Options
Option Action
All Prints the entire
document
Pages Prints pages you
specify by typing page
numbers in the textbox
Selected Records Prints selected records
only

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-73

Printing a
Selected page
Selected printer

Enter page numbers to print

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-74

Closing And Opening A Table


& Database
• Close table and save any layout changes
• Close database
• Click OPEN to open existing database file
• Select name of table to open

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-75

Closing a Table

Table name appears in the table object list

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-76

Closing the Database

Main menu
and toolbar
buttons are
available

Empty Access window

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-77

Opening a Database

Student names document

Access file names

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-78

Opening a Table

Open selected table object

Table name selected

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-79

Exiting Access
• Click X in the upper right corner of the Access
window
• Menu equivalent is File/Exit

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-80

Outline
 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
1-81

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

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-82

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

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-83

Key Terms continued


• Unbound object • Wizard
• view • workspace

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-84

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?

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-85

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?

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-86

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?

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-87

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.
McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.
1-88

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?

McGraw-Hill Technology Education © 2004 by the McGraw-Hill Companies, Inc. All rights reserved.

You might also like