Sie sind auf Seite 1von 47

Chapter Extension 8

Using Microsoft Access

Study Questions
Q1: How do I create tables? Q2: How do I create relationships? Q3: How do I create a data entry form? Q4: How can I create queries using the query design tool? Q5: How do I create a report?

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-2

Access Online Learning Resources


Office.microsoft.com/enus/access/default.aspx
Access 2007 Help Access 2007 Training Access 2007 Demos

Access 2007 Online Course


http://office.microsoft.com/training/training.aspx ?AssetID=RC101933201033

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-3

Q1: How Do I Create Tables?


Create data model from users requirements Transform model into database design
Select a primary key Select a foreign key

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-4

Attributes of the Database

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-5

PROSPECT Data

Table 1 CE6-2

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-6

WORK Data

Table 2 CE6-2

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-7

Starting in Access

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-8

Creating a Database with Access 2007


Click on Blank database at top of list Provide file name in lower right-hand corner box Click on folder icon to browse to a folder to save the database file Click on Create Window will open to a blank table

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-9

Creating a Database with Access 2007 (contd)


Click on the View icon in top left-hand corner Enter a table name in the pop-up box Window will change to Design View where you can name the fields of the table, data type and field properties.

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-10

Table Design View

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-11

Creating Tables in Access, Step 1


Screen has two parts
Upper part
Enter name of each attribute (Fields) Enter Data Type Enter Description (optional provides documentation)

Bottom part
Set properties for each field

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-12

Creating Tables in Access, Step 1 (contd)

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-13

Creating Tables in Access, Step 2

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-14

Complete Sample PROSPECT Table

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-15

Finished WORK Table

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-16

Creating Tables Steps (contd)


1. Enter Field Names and Data Types 2. Establish field lengths 3. Select primary key (Click on Primary Key icon) 4. Save table by clicking on diskette icon (upper left of Window)

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-17

Q2: How Do I Create Relationships?


Defining relationships
Go to Tools Select Relationships
Window opens Show Table dialog box displayed Double-click on names of tables Tables added to Relationships window Close Show Table dialog box

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-18

Show Table Dialog Box

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-19

Creating Relationship Between Two Tables


Click on the attribute in one table Drag it on top of the attribute in the second table A dialog box appears Click Enforce Referential Integrity Click Cascade Update Related Fields Click Cascade Delete Related Fields Close Relationships window Save changes
Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall CE 8-20

Creating Relationship Between Two Tables (contd)

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-21

Completed Relationship Between PROSPECT and WORK Tables

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-22

Tables with Data Entered PROSPECT

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-23

Tables with Data Entered WORK

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-24

Q3: How Do I Create a Data Entry Form?


Use the default table display
Displays related records Limited capability Interface not pleasing

Use Access Form Wizard


Click on Forms Double-click on Create form Select table from Tables/Queries combo box Double-click on double chevron button

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-25

Enter Data with Default Table Display

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-26

Q3: How Do I Create a Data Entry Form? (contd)


Click Create tab to open Create ribbon Click on PROSPECT table Click Form

Access uses table metadata and relationship to create data entry form Add, update, delete data in the form

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-27

Starting the Form Generator

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-28

Resulting Data Entry Form

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-29

Reformatted Data Entry Form

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-30

Process for Reformatting Data Entry Form

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-31

Q4: How Can I Create Queries Using the Query Design Tool?
Access processes SQL query language Provides graphical interface to create queries
Access generates SQL statements

Creating queries
Click Queries Double-click Create, then Query Design In Show Table, click to select table, then click Add See tables appear above Query Design form Access shows relationship between tables

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-32

Creating a Query, Step 1

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-33

Creating a Query, Step 2

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-34

Creating a Query (contd)


Drag columns from tables into grid
Lower part of query definition form

Click red exclamation point icon Access will show rows that have value matches in all tables Click Save icon

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-35

Creating a Query, Step 3

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-36

Results of TotalDonations Query

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-37

Result of More Advanced Query NameAndDonation

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-38

Q5: How Do I Create a Report?


Double-click Create Select Report Wizard Select table in Table/Queries combo box Highlight table PROSPECT, highlight Name in Available Fields list Click single chevron > Add EmailAddress the same way Select WORK table, add fields Date, Hour, NumCalls, TotalDonations Click Finish
Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall CE 8-39

Selecting Data to Show in a Report

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-40

Report Design View

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-41

Grouping and Totaling


Click Group and Sort in Grouping & Totals section of ribbon Bottom of form, click More Then click down arrow to with no totals Click Report icon in View section of ribbon See result on next slide

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-42

Report with Sum of TotalDonations

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-43

Changing Size of EmailAddress Field in Layout View

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-44

Final Version of Report

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-45

Active Review
Q1: How do I create tables? Q2: How do I create relationships? Q3: How do I create a data entry form? Q4: How can I create queries using the query design tool? Q5: How do I create a report?

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall

CE 8-46

All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America.

Copyright 2010 Pearson Education, Inc. Publishing as Prentice Hall


CE 8-47

Das könnte Ihnen auch gefallen