microsoft_access_2003_introduction.ppt
TRANSCRIPT
Course Objectives
In this course you will learn how to:Understand database concepts and terminology
in Access 2003Design and create tablesEnter and manipulate data in tablesUse Access queries to select and analyze
information in a tableCreate data forms for viewing and inputting
dataCreate reports that summarize and group dataPerform database maintenance procedures
What is Microsoft Access?
Powerful Relational Database Management System (RDBMS) design to run in Microsoft Windows
Data can be organized as a set of related tables
Integration with other Office applications allows seamless exchange of data with centralized database
What is an Access Database?Collection of data objects stored with filename extension .mdb (Microsoft database)Main Access data objectsTables QueriesFormsReportsMacrosModulesPages
Database Window
Database Window– Main database design/management window– Displayed when creating or opening an Access
database– You can use the Objects toolbar to access the
different objects that make up a database
TablesWhat is table
Basic container for data, arranged as a grid of rows and columns
Each row contains a single recordEach column represents a field within the record
Access tablesFundamental data objects in Access
Forms, queries and reports are all based on tablesTable Wizard provides automated table creationTables can also be created manually for more
precise specification
Forms
What is formElectronic version of paper formUsed to simplify entry of data into an Access
database
QueriesWhat is a Query?
A question asked of the databaseUsed to extract specific information from databaseUsed to extract specific information from database
Example:What is the three top-selling products in our company’s product line?
Queries are composed of structured query language(SQL) statements Example: SELECT Products.[Product #], Products.[Product Name], Products.PriceFROM ProductsWHERE (((Products.Price)<4.75));
Access allows queries to be created graphicallyHides complexity of SQL language
ReportWhat is report?
Formatted template used to print reports of database or query results
Allows user to specify fields, grouping levels, arrangement of printed data
MacrosWhat is access macro?
User-defined sequence of actions to be performed by Access 2000
Macros will not be covered
ModulesWhat is a module?
User-created sections of code which provide sophisticated automation of Access functions
Written in Visual Basic for Application(VBA)
Creating DatabaseCase study scenario:
In this section, we will create a database (including tables, forms, reports, and queries).
The database we will create will have addresses.
Creating a new databaseStart AccessSelect “Create new database using blank
database”Assign a name for the new database
AddressBook.MDB
Create New TableCreating a new table
In the database window, select the Tables tab, then click on New
Table creation optionsDesign View
Manual table creation by user(maximum control over table specifications)
Table WizardAutomated table creation facility
Import table Import data from external tables
Link TableLink to data in external tables
Creating a new table in Design ViewFor each field in new database,specify
the following itemsField Name
Descriptive name of field to be used in table 64-character maximum Prohibited characters:period(.), accent grave(‘), square
brackets([]), exclamation point(!)Data Type
Drop-down list displays available data types Number, Date/Time, Currency,Auto number, Yes/No, OLE
Object, Hyperlink, Lookup WizardDescription
Comment describing details of field. Appears on the status bar in Datasheet view when you click a row in the field's column
Access Data Types.
Data Type Usage Size
Text Alphanumeric data Up to 255 characters
Memo Alphanumeric data—sentences and paragraphs Up to 64,000 characters
Number Numeric data 1, 2, 4, or 8 bytes (16 bytes for ReplicationID and Decimal)
Date/Time Dates and times 8 bytes
Currency Monetary data, stored with 4 decimal places of precision 8 bytes
AutoNumber Unique value generated by Access for each new record 4 bytes (16 bytes for ReplicationID)
Yes/No Boolean (true/false) data <1 bit/FONT>
OLE Object Pictures, graphs, or other ActiveX objects from another Windows-based application
Up to about 1 gigabyte
Hyperlink A link "address" to a document or file on the World Wide Web, on an intranet, on a local area network (LAN), or on your local computer
Up to 2048 characters
Fields properties
Field Property Purpose/Note or Example
Field size Specifies amount of storage for data in fieldNote: Test maximum field size = 255 characters
Format Predefined formats for field dataEx: Short date =11/25/97
Input Mask Formatting mask for user data inputEx:Phone number input mask = (XXX)-XXX-XXX
Default Value Specifies default value in fieldNote: Speeds up data entry.
Required Specifies that a value must be entered in field
Indexed Tells Access to create an index for this data fieldNote: Speeds up data searches based on this field
Setting a Primary KeyWhat is a primary key?
Main index for table Must be unique for each record in table
Example: Product number, Employee number, etc.If no such field exist, create a new field with the
data type “Autonumber” and specify it as the primary keyAccess will automatically create unique numbers for
this fieldAssigning a field as the primary key
Select fieldClick on Primary Key button on toolbar (or use
“Edit /Primary Key”)A key symbol will appear next to selected field
Saving the tableSelect “File/Save” or click on the close button
for the Table Design View windowAccess will prompt you to enter a name for
the new table Table name can be up to 64 characters
Entering data into a Table Entering data using Datasheet view
From the Access database window, select the table of interest Click on Open
o The table will be displayed in datasheet view Type new data directly into fields on datasheet
Adding/Deleting records Add new records in empty record at bottom of datasheet Delete records by selecting record, then use Edit/Delete Record
Sorting records Click on data field to be sorted Click on sort buttons on toolbar (Ascending and Descending)
Disadvantages of datasheet data entry Clumsy to enter data into tables with large number of fields Forms are usually a better choice
Working with tables Adding records – Insert / New Record Modifying the table design – Format / Data Sheet Finding and editing records – Edit / Find Deleting, adding, and copying records and values – Edit /
Cut, Copy, Paste Filtering and sorting – Records / Filter
Creating FormsForm advantages
Simplifies data entry processAble to display many entry fields on one
screen Most commonly used form creation
options
New form options DescriptionDesign View Manual form creation (maximum
control)
Form Wizard Automated form creation assistant
Auto form Automatically creates form without user intervention
Creating forms with Form Wizard
Using Form WizardFrom the Access database window, click on the
Forms tab, then click on NewThe New Form dialog box will be displayed
Select the name of the table or query to be used to create the new form
Form creation stepsField selectionForm layoutStyle
Using the New FormForm navigation
The form wizard displays the new form at the end of the form creation process
The contents of the first record are displayedRecord navigation controls(lover left
corner of form
Record navigation control Action
|< Move to first record
< Move to previous record
> Move to next record
>| Move to last record
>* Move to new blank record
Creating queriesWhat is query?
Structured request for specific ingomation from database
Created in Access using New QueryQuery created with graphical tools(Query by
example)Underlying code produced in SQL
Creating a query in design viewFrom Access database window, select Queries tab,
then click on NewSelect Design View
Specify fields to showSelect the fields to be displayed by clicking on the Show
checkboxSpecify criteria
Enter the criteria expression for the desired field in the query grid
In this example, we want to select all products whose price is less than$4.75 We will set the criteria for the Price column to “<4.75”
if multiple fields have criteria set, they must all be satisfied to select record (logical AND)
Viewing SQLUse View/SQL to see a listing of the SQL statements
produced by the design
Creating ReportsUsing the Report Wizard
From the Access database window, click on Reports tab,then click
Report creation stepsField selectionSort orderLayoutStyleTitle/preview