Академический Документы
Профессиональный Документы
Культура Документы
Introduction
MS Access
Relational data model
Data is stored in tables incorporated into database files with extension mdb or accdb
Marina G. Erechtchoukova
(cont. )
Forms are parts of user interface. Forms are used to enter, edit or browse data from a database
Reports present requested information and allow to create hard copies.
Marina G. Erechtchoukova
Data Types
Text Memo Numbers
Byte Integer Long integer Single Double
Date/time
Marina G. Erechtchoukova
Create Table
Using Wizard Design View
Specify field names Data types Properties Determine a primary key Save the table
Marina G. Erechtchoukova
Access Tables
Design view
Table structure is created and may be edited
Datasheet view
Display table content in spreadsheet-like grid, Used for entering, editing or deleting data from tables
Marina G. Erechtchoukova
In MS Access 2007 and up choose Database Tools tab and then Relationships Use drag-and-drop features and select Enforce Referential Integrity option Tip specify referential integrity constraints before data is entered
Marina G. Erechtchoukova 9
Queries
Specify the source of data If multiple tables are used, specify relationships between tables Select desirable fields from the table(s) and options related to the fields Specify a criterion
Marina G. Erechtchoukova
10
Query Criteria
To be selected a record must satisfy a criterion Expressions may contain the following operators:
Math Operators Relational operators Boolean Operators String Operators Miscellaneous Operators
Marina G. Erechtchoukova 11
Math Operators
+
*
Addition
Subtraction Multiplication
/
\ ^ Mod
Division
Integer Division Exponentiation Modulo (remainder) division
Marina G. Erechtchoukova
12
Relational Operators
= <> < > <= >= Equal Not equal Less than Greater than Less than or equal to Greater than or equal to
Marina G. Erechtchoukova
13
Boolean Operator
And
Or
Logical And
Logical Or
Xor
Excusive Or
Not
Negation
Marina G. Erechtchoukova
Concatenation
Similar to
Between Between 2 values inclusive and In (list) One from the list
Is Null True if the field is empty
Marina G. Erechtchoukova
15
Access Forms
Create using Form Wizard Create using Form Design view
Specify source of data will be presented by the form
Table Query
Specify fields related to the form Add labels, titles, graphics and so on
Marina G. Erechtchoukova 16
Form Controls
Must be bound with fields from the source table or query Contain data from correspondent fields, labels or other controls (like command button) or another form called subform
Marina G. Erechtchoukova
18
Viewing Forms
Open database Click Forms tab to display all available forms in the database Select the form Select Open To view data use Form Navigation Tools. To prevent data Editing, use Locked Property for the Text Boxes
Marina G. Erechtchoukova 19
Creating Subforms
Represent 1:N relationships To add a subform to a form
Create a form that will be a subform Click on Subform/Subreport button and then click on a form where the subform should appear Specify the source for the subform Specify the fields to link the form and subform
Marina G. Erechtchoukova 20
Reports
Reports present table contents or query results in an easily assimilated format Reports have Design view and Print Preview Report Design View is similar to the Form Design view
Marina G. Erechtchoukova
21
Report Types
Columnar reports a single record on a page Tabular reports datasheets: fields from the tables are presented as columns Justified reports combine two previous types of the reports
Marina G. Erechtchoukova 23
Creating Reports
With a Wizard Design view:
Specify source for the report Select Fields from the Fields List Add labels Add format Switch the view to see the result.
Marina G. Erechtchoukova
24