Professional Documents
Culture Documents
MS Access 47
(Tables)
1. (Primary Key) Access;
Access,
. .,
.
, .
,
, . ,
,
,
.
2. (Index) ;
,
.
, Access
,
.
. Access , ..
, , , ,
, Access
.
, Access
(no duplicates) (yes
duplicates). , ,
, ,
, , .
, , ,
.
3.
;
,
,
.
.
1
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
,
.
, Access
, .
, ,
, : >= 0 and <=20 between 0 and 20. , ,
15 17, Access.
, , /
, : or / or .
Access ,
. ,
.
,
.
5. , (Relationship)
Access;
, .
.
.
, Show Relationships
()
. , ,
. Access
1
.
(one to many).
,
<delete>, , ,
, ,
. ,
.
,
. ,
,
(ID_?ae) ,
, .
, , ..
, .. Access
.
6. (Referential Integrity);
2
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
,
.
.,
, ,
.
. -,
,
, ,
. ,
,
.
, , , Access
. ,
,
, .
7. (Cascade Update);
, ,
,
.
,
,
, ,
.
8. (Cascade Delete);
, ,
,
.
,
,
, . ,
Access , .
9. (one to many);
, , ,
, .
, .
, ,
.
3
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
,
.
, , ,
, .
,
.
,
.
,
.
, , ,
, .
,
.
,
.
,
.
12. Access . , ,
, ;
,
. ,
, .
, ..
, , ,
. ,
.
13. Access . , , ,
;
, ,
-. ..
, ,
.
4
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
14. (Query);
Access ()
/ .
. .
(Select Query).
,
. , ,
100.000 .
, , . ..
/ 100.000 300.000 .
, ,
, .
15. Access ;
()
, . And
Or. And ,
Criteria.
Or Or,
Criteria. , , Criteria ,
And Or , .
.
:
LIKE
LIKE *
LIKE *
LIKE **
LIKE []*
(, /, )
Or
LIKE ??* , ,
LIKE ##00 00
5
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
LIKE [!]* ,
, Show (),
. ,
.
, , ,
;
.
:
.
LIKE . , , ,
.
, , , . ,
Show .
.
. :
Sum (), Count (), Avg ( ), Min ( ) Max (
).
,
(Group by). Totals.
, Access ,
.
, , (group by)
count .
,
sum .
Access
. ,
.
(Update Queries),
, (Delete Queries),
, (Add Queries),
(Make Table Queries),
.
6
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
20. Access;
Access, , ,
, ,
, .
, ,
10%,
:
[] * 1.1
,
.
, , :
[ ] + [ ] * 1.2
, , Access,
(Update Queries) (module).
(Forms)
21. Access ;
Access
(Tables) (Queries) .
(table) (query) Access
. , .
.
()
,
.
,
. ,
.
PageUp
PageDown . ,
.
, ,
(datasheet) . ,
, .
22. ;
. ,
7
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
.
, , ,
,
.
, (control box)
(ab ), : ([-1]+[-2]+...)/10,
.
, .
, .
,
. .
, , , , ,
(video) Windows .
' .
. ,
/, , ,
,
, .
, , , Access
. , ,
. , ,
.
,
,
(datasheet).
23. ;
(toolbox)
, , ,
, , , , .
Oi (properties)
, (details), ,
, .
, : Format (), Data
(), Event (), Other ( ) All ()
.
24. ;
, . , ,
: (labels) (text boxes).
(, , , ),
, ,
,
. ()
.
8
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
.
, ,
. , ,
. , ,
,
. ()
ab .
(control boxes)
.
(option buttons),
(check boxes) (toggle buttons).
.
, O
.
,
.
.
, Telestet
, : economy, business,
city business plus. Telestet
.
, ,
, ,
,
Telestet. , ,
, .
(labels) .
Access
.
.
(/ - -
), . , ,
,
, .
: .
,
.
. ,
.
9
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
. , ,
; .
, .
, , .
,
,
,
. ,
(Limit To List - Yes).
,
, , .
, . ,
, video
( ).
Visual Basic for Applications (VBA) Access.
,
, .
,
.
,
..
29. (SubForm);
. ,
,
,
.
, , ,
.
(Reports)
30. Access ;
10
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
(reports) Access
(table) (query) Access.
()
, ,
(sum) .
,
(Report Wizards). , ,
, .
31. (Grouping);
Access
. /,
.
,
(group header) / (group footer).
,
Access , .
,
.
32. .
;
. , .
,
(, , ..)
.
, , , ,
( ..).
,
.
, , , .
, , .
, . ,
. ,
.
, , .
, ,
1 ,
, 2
.
11
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
(Macros)
33. Access ;
(macros) Access
. , ,
(conditions), ,
.
Access ,
. .,
, Access.
Close ( , ),
OpenForm ( ),
OpenReport ( ),
RunCode ( VBA),
RunMacro ( ),
StopMacro ( ),
GoToRecord ( ),
GoToControl ( ),
Maximize ( ),
Beep ( ),
Msgbox ( ).
. ,
:
[].[]
() ,
:
Forms![]![]
:
, ,
Event () OnClick
.
. , ,
.. , , , ..,
' .
(Modules)
34. Access ;
12
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
(modules) Access
Access. Access ,
.
Access . ,
, , , , (),
(functions) (subroutines).
35. ;
, .
, .
Modules ().
36. ;
.
Code (E)
Code View.
37.
.
Access Declarations (),
.
(Object)
, General.
,
(Proc)
.
(Proc)
,
. ,
.
38. ;
13
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
, Function () Sub ()
(Insert Procedure)
Procedure Insert. Access
End Function End Sub .
39. VBA
VBA
.
: Byte, Integer (%), Long (&), Single (!), Double (#), Currency (@), String
($), Boolean, Date Object, Variant User-defined.
.
40.
( ),
(
).
, Public
Declarations . ,
Public Const Declarations.
, Declarations .
, .
,
.
, , ,
. .., module1.intx module2.intx
(intx) .
, , , .
.
VBA
41.
Const
..
Dim
14
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
Declarations
. , ,
Dim
.
..
Public
Declarations .
..
Private,
. Private default.
ReDim
..
Static
Access
.
..
Type
15
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
Declarations
.
Type .
,
Dim, Public Static
.
,
, .
..
Type MyRecord
lngID As Long
strLast As String
strFirst As String
strMid As String
End Type
...
usrContacts.strLast = Jones
42. Access
Option Base 1
-32.768
32.767.
43. Set
, .
:
16
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
dbMyDB .
tblMyTable tblClubs .
44.
Access
.
.
Move
. .. recordset.MoveFirst .
MoveLast, MoveNext MovePrevious.
, Find
. ,
AmountOwed 100$, :
,
Delete. ,
AmountOwed 0, :
rcdAPContracts.FindFirst AmountOwed = 0
17
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
rcdAPContracts.Delete
End If
,
Edit. ,
Update . , 10%
AmountOwed 100, :
rcdAPContracts.Edit
rcdAPContracts.Update
End If
,
AddNew.
Update .
rcdClubs.AddNew
rcdClubs![City] = Winthrop
rcdClubs![State] = WA
rcdClubs![ZipCode] = 98862
rcdClubs.Update
45.
VBA , , :
(Functions) (Subroutines).
. ,
.
Function
18
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
Function ,
,
.
. ByVal
, . ,
ByVal , .
ByRef ,
. , ByRef
, .
Exit Function
, .
, MyFunction
, :
< >
End Function
Sub
Sub ,
.
Exit Sub ,
.
, MySub
, , :
< >
End Sub
46.
Call
..
19
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
Do ... Loop
.
While Until,
.
..
Do Until rcdClubs.EOF
< >
rcdClubs.MoveNext
Loop
..
For intI = 0 To 4
Debug.Print dbEntSched.QueryDefs(intI).Name
Next intI
..
Debug.Print qdf.Name
Next qdf
GoTo
, , .
..
20
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
GoTo SkipOver
..
intVal = 1
intVal = 2
intVal = 3
Else
intVal = 0
End If
Select Case
,
.
..
Case A To F
intVal = 1
Case G To N
intVal = 2
21
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
Case O To Z
intVal = 3
Case Else
intVal = 0
End Select
Stop
..
< >
rcdClubs.MoveNext
Wend
With
With Pascal.
..
Set db = CurentDb()
With rst
.Addnew
![FieldOne] = 1
![FieldTwo] = John
22
PDF created with pdfFactory trial version www.pdffactory.com
MS Access
![FieldThree] = Viescas
.Update
.Close
End With
47.
VBA . ,
, VBA,
VBA.
VBA, DoCmd.
DoCmd
.. Customer ,
:
Supplier, :
23
PDF created with pdfFactory trial version www.pdffactory.com