MICROSOFT ACCESS – Lab 1
What is a database? an organized collection of related data
What is a relational database? files that contain common fields such as social security number or last name can be linked and information can be shared; database takes form of relational table consisting of rows (records) and columns (fields)
What are the advantages of using a database?
Integrated files (tables), Shared Data, Reduced Redundancy, Centralized Security
Once data is entered, records can be quickly located by searching the database for a known entry in a field
Records can be easily added, deleted, or modified
Records can be organized in a meaningful fashion
Calculations can be performed on all fields or on specified fields
Professional reports can be generated that include different layout styles, titles, totals, etc.
CREATING A DATABASE - To create a database:
Select File, New Database or Click New Database icon (1st icon on toolbar)
Default extension is mdb for all Access database files
Select appropriate drive using Drives drop-down box
Enter a filename
CREATING A TABLE - To create a table:
Select New, New Table (default for creating a database table)
Design view window is displayed and you can now define your structure
DEFINING THE DATABASE STRUCTURE (FIELD NAMES) - the FIELD NAME is the first piece of information which must be entered. Field names:
Should be descriptive of the contents of the data to be entered in that field
Can be up to 64 characters long and can consist of letters, numbers, spaces and special characters
Must be unique
Can be typed in either upper- or lowercase letters
DEFINING THE DATA TYPE and FIELD PROPERTIES - the next piece of information entered is the DATA TYPE or the type of information the field will contain. Data Types come in eight different categories and the most common are:
Text - can include letters, numbers, spaces, or any printed characters, except for numbers used in calculations
Number - can contain digits 0 through 9 only
Date/Time - can contain valid dates from January 1, 100 to December 31, 9999. Access checks all dates for validity and adjusts entries for leap years
Currency - same as number but formatted to display decimal places and dollar signs
Select data type from drop-down box (default is text)
The next piece of information is FIELD PROPERITIES for each field type where you can adjust field size, format, input mask, caption, etc. The properties available depend on the data type, i.e. you cannot set the field size for a date field. F6 switches between defining structure pane and field properties pane
The next peice of information is the FIELD DESCRIPTION. The table will be easier to understand and update if information is entered in the field description box.
DEFINING THE PRIMARY KEY FIELD - each table must have a PRIMARY KEY field that uniquely identifies each record and prevents duplicate records from being entered into the table. To identify a field as a primary key, make sure the insertion point is somewhere in that field, Select Edit, Set Primary Key or Click "Key" icon.
SAVING THE TABLE STRUCTURE - Choose File, Save As
ENTERING DATA - Once the table structure is defined and saved, data can be entered into the new table datasheet. To view the table datasheet:
Select View, Datasheet or Click Datasheet view icon (in datasheet view, you can enter records, delete records, and edit fields in existing records)
Moving around in Datasheet view - same as always. ie Tab, SHIFT Tab, arrow keys
DIFFERENT VIEWS – Access has several different views for looking at and working with database objects: Design, Datasheet, Form, and Preview
INSERTING A PICTURE – To insert a picture in a table:
Insert, Object
ADJUSTING COLUMN WIDTHS - default width is 18.8 characters. To adjust field widths:
Drag border or Choose Format, Column Width and type a width or choose Best Fit
Select OK
ADDING RECORDS IN DATA ENTRY – suppresses existing records as you enter new ones.
Records, Data Entry
PREVIEWING AND PRINTING – File, Print Preview or File, Print
CLOSING and OPENING A DATABASE - File, Close ; File, Open
EXITING ACCESS - File, Exit