ms acess
TRANSCRIPT
-
7/30/2019 Ms Acess
1/24
MS AccessIntroduction
-
7/30/2019 Ms Acess
2/24
Marina G. Erechtchoukova 2
MS AccessRelational data model
Data is stored in tables incorporated into
database files with extension mdb oraccdb
Standard Windows interface
Standard Help systemPart of MS Office suite
-
7/30/2019 Ms Acess
3/24
Marina G. Erechtchoukova 3
Access Database ObjectsTables contain rows called records andcolumns called fields.
Queries are requests for specificinformation from a database.
Queries are virtual tables built on a
given SQL statement
-
7/30/2019 Ms Acess
4/24
Marina G. Erechtchoukova 4
Access Database Objects
(cont. )Forms are parts of user interface. Formsare used to enter, edit or browse data
from a database
Reports present requested information
and allow to create hard copies.
-
7/30/2019 Ms Acess
5/24
Marina G. Erechtchoukova 5
Data TypesText
Memo
NumbersByte
Integer
Long integer
SingleDouble
Date/time
Currency
AutoNumber
Yes/NoYes/no
True/False
1/0
OLE ObjectsHyperlink
Lookup Wizard
-
7/30/2019 Ms Acess
6/24
Marina G. Erechtchoukova 6
Create a Database in MS Access
2007 and up
Click on the round Office button
Choose Newfrom the drop-downmenu
In Create Blank Database window
specify the database nameClick Create
-
7/30/2019 Ms Acess
7/24Marina G. Erechtchoukova 7
Create TableUsing Wizard
Design View
Specify field names
Data types
Properties
Determine a primary key
Save the table
-
7/30/2019 Ms Acess
8/24Marina G. Erechtchoukova 8
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
-
7/30/2019 Ms Acess
9/24Marina G. Erechtchoukova 9
Referential Integrity
ConstraintsReferential Integrity
Can be established or removed in Relationshipwindow
In MS Access 1995-2003 open menu Toolsand chooseRelationshipsfrom the drop-down menu
In MS Access 2007 and up choose Database Toolstab and then Relationships
Use drag-and-drop features and select EnforceReferential Integrityoption
Tip specify referential integrity constraints beforedata is entered
-
7/30/2019 Ms Acess
10/24Marina G. Erechtchoukova 10
QueriesSpecify 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
-
7/30/2019 Ms Acess
11/24Marina G. Erechtchoukova 11
Query CriteriaTo be selected a record must satisfy acriterion
Expressions may contain the followingoperators:
Math Operators
Relational operators
Boolean Operators
String Operators
Miscellaneous Operators
-
7/30/2019 Ms Acess
12/24Marina G. Erechtchoukova 12
Math Operators+ Addition
- Subtraction
* Multiplication/ Division
\ Integer Division
^ ExponentiationMod Modulo (remainder) division
-
7/30/2019 Ms Acess
13/24Marina G. Erechtchoukova 13
Relational Operators= Equal
Not equal< Less than
> Greater than
= Greater than or equal to
-
7/30/2019 Ms Acess
14/24Marina G. Erechtchoukova 14
Boolean OperatorAnd Logical And Both operands are true
Or Logical Or Either one of the
operands or both of
them are true
Xor Excusive Or Only one of the
operands (not both ofthem) are true
Not Negation Operand is not true
-
7/30/2019 Ms Acess
15/24Marina G. Erechtchoukova 15
String and Miscellaneous
Operators& Concatenation
Like Similar to
Betweenand
Between 2 values inclusive
In (list) One from the listIs Null True if the field is empty
-
7/30/2019 Ms Acess
16/24Marina G. Erechtchoukova 16
Access FormsCreate using Form Wizard
Create using Form Design view
Specify source of data will be presented bythe form
Table
QuerySpecify fields related to the form
Add labels, titles, graphics and so on
-
7/30/2019 Ms Acess
17/24Marina G. Erechtchoukova 17
Form Design viewForm Headera place for titles,graphics, additional information
Form Details section the fields used tocreate a form and control elementsrelated to the fields
Form footera place for any itemswhich will appear at the bottom of theform
-
7/30/2019 Ms Acess
18/24
Marina G. Erechtchoukova 18
Form ControlsMust be bound with fields from thesource table or query
Contain data from correspondent fields,labels or other controls (like command
button) or another form called subform
-
7/30/2019 Ms Acess
19/24
Marina G. Erechtchoukova 19
Viewing FormsOpen database
Click Forms tab to display all available
forms in the databaseSelect the form
Select Open
To view data use Form NavigationTools. To prevent data Editing, useLocked Property for the Text Boxes
-
7/30/2019 Ms Acess
20/24
Marina G. Erechtchoukova 20
Creating SubformsRepresent 1:N relationships
To add a subform to a form
Create a form that will be a subformClick on Subform/Subreport button andthen click on a form where the subformshould appear
Specify the source for the subform
Specify the fields to link the form andsubform
-
7/30/2019 Ms Acess
21/24
Marina G. Erechtchoukova 21
ReportsReports present table contents or queryresults in an easily assimilated format
Reports have Design view and PrintPreview
Report Design View is similar to the
Form Design view
-
7/30/2019 Ms Acess
22/24
Marina G. Erechtchoukova 22
Report Design ViewPage Header contains data and graphicsappearing at the top of each page
Report Header contains the data and graphicsappearing at the top of the first report page
Detailed section contains data from tables orqueries
Page Footer contains the data and graphics
appearing at the bottom of every pageReport Footer contains the data and graphicsappearing at the bottom of the last reportpage
-
7/30/2019 Ms Acess
23/24
Marina G. Erechtchoukova 23
Report TypesColumnar reports a single record on apage
Tabular reports datasheets: fieldsfrom the tables are presented ascolumns
Justified reports combine two previoustypes of the reports
-
7/30/2019 Ms Acess
24/24
M i G E ht h k 24
Creating ReportsWith 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.