Your Tour Guide is Jim Provensal. What We Will Cover s Introduction to MicroSoft Access u What is a...

94
Your Tour Guide is Jim Provensal

Transcript of Your Tour Guide is Jim Provensal. What We Will Cover s Introduction to MicroSoft Access u What is a...

Your Tour Guide is Jim Provensal

What We Will Cover

Introduction to MicroSoft Access What is a database What is a “Relational” Database

The Major Steps and elements of a MicroSoft Access Database

A Tour of the “NorthWind Traders” Database

What We Will Cover

In this session, we will explore the elements of MicroSoft Access, and in the following sessions, we will be building a database application step-by-step using these elements.

We Will Continue to explore

Building a database with Access Defining Tasks Defining the database Creating the database

We Will Continue to explore

Fields Primary Keys Validation Rules Relationships Indexes and database limitations

We Will Continue to explore

Modifying a database design Inserting & changing fields Changing attributes and primary

Keys Splitting tables And More on Relationships

We Will Continue to explore

Using and viewing datasheets Modifying the datasheet sorting, searching and printing

a datasheet

We Will Continue to explore

Select Queries And Query Wizards The basic QBE Grid (Query by Example) Calculated Fields Expressions in Queries Criteria in Queries

We Will Continue to explore

Because Queries are the heart of MicroSoft Access we will continue exploring queries and their uses.

We Will Continue to explore

Special & Action Queries Total & Crosstab Queries Make Table Queries Append Queries UpDate and Delete Queries

We Will Continue to explore

An introduction to basic

form design and setting

object properties

We Will Continue to explore

Customizing Forms

Calculated fields

Subforms

We Will Continue to explore

Report building

from scratch and

using Wizards

and Sorting & Grouping

Before we continue we need to cover some administrative items.

Course Syllabus A Discussion on the Student Disks E-mail Addresses Introductions Questions?

What is a Database?

In the simplest sense, a database is a collection of records and files that are organized for a particular purpose!

Microsoft Access as an RDBMS

Microsoft Access is a fully functional

Relational Database Management System

Microsoft Access is a database. This means that it is a program that will store lists of information. These lists are called “Tables”.

Microsoft Access is a toolbox that will assist the userin creating a system that will automatically managethe information stored in the tables.

This means that Access is not only a database,but a “Database Management System”.

Since some lists (or tables) contain information thatis related to other lists, the user can tell Access whichlists are related and what piece of information in eachlist should be used to connect each list.

This means that Microsoft Access is aRelational Database Management System.

Main Functions of a Database Data definition Data manipulation Data control Data reporting

Main Functions of a DatabaseMain Functions of a DatabaseData definition

You can define what data will be stored in your database,the type of data (for example, numbers or characters),and how the data is related. In some cases, you can alsodefine how the data should be formatted and how thedata should be validated.

Main Functions of a Database

Data manipulation

You can work with the data in many ways.Select which data fields you want, filter the data and then sort it.

You can join data with other related information.

You can Summarize (group, subtotal and total) the data.

Main Functions of a DatabaseMain Functions of a Database

Data control

You can define who is allowed to read, update,or insert data. In many cases, you can also definehow data can be shared and updated by multipleusers.

Main Functions of a DatabaseMain Functions of a Database

Data reporting

You can create and save “Pre-defined” reportformats that at a click of the mouse can produceup to the minute reports showing (in most cases)data that is within seconds old.

What is MicroSoft Access?AccessAccess is a very powerful “Tool Box” that will allow you to not only “Collect” data, “Store” data, “Manipulate” data, and “Report” data, but it will also allow you as a “Non-Programmer” to create actual applications (programs) for others to use. These applications in most cases can be put together quite quickly and madeto look very professional.

The Major Steps of a MicroSoft Access Database

TablesTablesQueriesQueriesFormsFormsMacrosMacrosReportsReportsModulesModules

1) TABLES: The basic element of a data base used only to store raw data.

2) QUERIES: Sets of data consisting of some or all data from one or more tables with related data.

3) FORMS: Screens that are linked to either tables or queries and are used for data entry data editing and controlling what data is accessed and how it looks.

5) MACROS & Modules: Tools used for automation of tasks.

4) REPORTS: Pre defined and pre designed output documents generally used for hard copy output.

A collection of related tables is called a database, or relational database. Our Case Study’s database will contain two related tables:

The Customer table, which has already created, and

The Order table which you will create in Tutorial #2.

Sometimes you might want information about customers and the orders they placed. To obtain this information you must have a way to connect records in the Customer table to records in the Order table.

You connect the records in the separate tables through a common field that appears in both tables.

Figure 1-2 shown on page AC-1.05 of your book shows that each record in the customer table has a field named Customer Number, which is also a field in the Order table.

Each Customer Number in the Customer table must be unique, so that you can distinguish one customer from another and identify the customer’s specific orders in the Order table.

The Customer number field is referred to as the primary key of the Customer table. A primary key is a field, or a collection of fields, whose values uniquely identify each record in a table.

In the Order table, the Order Number field is the primary key for that table.

When you include the primary key from one table as a field in a second table to form a relationship between the two tables, it is called a foreign key in the second table as shown above.

In a table, the rows are called records and the columns are called fields.

Records

Fields

A relational database management system (DBMS) allows you to create database structures containing fields, tables, and relationships.

It lets you easily add new records, change field values in existing records, and delete records.

It contains a built-in query language, which lets you obtain immediate answers to the questions you ask about your data.

It contains a built-in report generator, which lets you produce professional-looking, formatted reports from your data.

It provides protection of data through security, control, and recovery facilities.

TABLE

QUERY

TABLE TABLE

QUERY

FORM REPORT

RELATIONSHIPS

CRITERIA

DATA ENTRY VIEW AND EDIT

OUTPUT

RAW DATASTORAGE

An Access Database Consists of:

If you haven’t already powered up your computer, lets do so now.

Let’s take a look at the basic elements that we will encounter when we first create a database or open an existing one for modification.Let’s start Access now and open a new database.

Title Bar

Menu Bar

Tool Bar

Database Window

Status Bar

Object List

Command Buttons

Object Buttons

Before we begin working on our Case Study’s database and using Access, we need to understand a few key terms and concepts associated with databases.

Before storing data on a computer, you first must organize the data.

We can do this using a data analysis technique, identifying the individual groups of data that will eventually be called tables and each unique item in each group that we will call fields.

A field is a single characteristic or attribute of a person, place, object, event, or idea. For example, some of the many fields that Valle Coffee tracks are customer number, customer name, customer address, customer phone number, order number, billing date, and invoice amount.

Next, you group related fields together into subjects, or tables. A table is a collection of fields that describe a person, place, object, event, or idea.

Data Analysis

IdentifyTasks

RecordCustomer

Orders

Subject #1(Tabe)

Subject #2(Table)

Subject #3(Table)

v

TaskAnalysis

DataAnalysis

The design phase of databases can be summarized into three steps:

1) Identify the task (keep your focus as narrow as possible for each task).

2) Identify all the unique pieces of information that is available.

3) Sort each piece of information gathered into related groups.

In your syllabus that was handed out a short time ago, you will find two forms.

A Task Sheet &a Subject Sheet.

Please find themnow.

Using these forms, let’s take a few moments to try a short exercise that demonstrates how we might go about the initial design phase of a database.

After the design is complete on paper it is time to create the database and set up your tables.

Click on the Blank Database Button

If you exited Access please re-start it now.

On the next screen click on Blank Database then OK

Click onBlankDatabase

Then Click onthe OK Button

Name the databasePro.mdb

Then click thecreate button

Select My Documents

You have now created a new (empty) database and

Your screen should look like this.

Do you remember The Major Steps of a MicroSoft Access Database?

TablesTablesQueriesQueriesFormsFormsMacrosMacrosReportsReportsModulesModules

Here they are. These arecalled Objects in Access.

Let’s create a new table in our database.

First, make sure that the table tab is selected.

Then click on the “New” Button.

Now, select design view from the dialog box.

We should now have a new table and we are ready to setupfields in the table. But first, let’s look at the elements of thetable design screen.

Field Name

Data Type

Description

Let’s add our first field.

Type Account Numberin the first Field NameRow above, then pressthe Tab key.

As soon as you enter the data type column you will notice a pull down selection arrow. You may either click on this arrow or press the F4 key to see the data types available

You will find a chart of the different data types available and the properties available for each data type on page AC 2.05 in your book.

You will find a chart of the different data types available and the properties available for each data type on page AC 2.05 in your book.

It’s now time to define the fields that we will be using in our table.

Let’s take a few moments to create the following fields in our new table.

Account Number: TextFirst Name: TextLast Name: TextAddress: TextCity: TextState: TextZip: TextPhone Number: TextDate of Birth: Date/Time

Account Number: TextFirst Name: TextLast Name: TextAddress: TextCity: TextState: TextZip: TextPhone Number: TextDate of Birth: Date/Time

What is a Primary Key?

To set the primary key1st click on theAccount NumberField

Then click on the Primary Key Button onthe tool bar.

It’s now time to save our new table.

Select File on the Menu Bar.

Then Select Save As since this is the first time that we have saved.

Use Table1 (the default)and then click on theOK button.

After you have created and saved a table, it’s time to add data. From the menu bar, select View and then Datasheet View.

When you first open a datasheet, Access selects the first field value in the first record.

The current record symbol appears in the record selector to the left of the first record. The current record symbol identifies the currently selected record.

Clicking a record selector or field value in another row moves the current record symbol to that row. You can also move the pointer over the data on the screen and click one of the field values to position the insertion point.

The navigation buttons provide another way to move vertically through the records.

The Navigation Buttons From Left to Right:

This button will bring you to the first record

This button will bring you to the previous record

The Navigation Buttons From Left to Right:

This area indicates the currently active record. You can press the F5 key to go here and then type the record # that you would like to go to.

The Navigation Buttons From Left to Right:

This button will bring you to the next record

The Navigation Buttons From Left to Right:

This button will bring you to the last record

The Navigation Buttons From Left to Right:

This button will bring you to the data entry mode so that you can enter a new record.

The Navigation Buttons From Left to Right:

Page AC 1.13

Quick Check Review

Quick Check Review

Let’s take a fewmoments to break upinto discussion groups.Each group will discussthe quick check questions on pageAC 1.13. We will then review the answers at the end of the discussion.

1) A(n) _______ is a single characteristic of a person, place, object, event or idea.

Quick Check Review

2) You connect the records in two separate tables through a(n) ________ that appears in both tables.

Quick Check Review

3) The ________, whose values uniquely identify each record in a table, is called a _________ when it is placed in a second table to form a relationship between the two tables.

Quick Check Review

4) In a table, the rows are called _________ and the columns are called _________.

Quick Check Review

5) The ________ identifies the selected record in an Access table.

Quick Check Review

6) Describe the two methods for navigating through a table.

Quick Check Review

Your Tour Guide is Jim Provensal