3. ???????????????????Access???(????.mdb) - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

3. ???????????????????Access???(????.mdb)

Description:

Title: Author: Last modified by: wcr Created Date: 5/17/2001 7:20:20 AM Document presentation format – PowerPoint PPT presentation

Number of Views:64
Avg rating:3.0/5.0
Slides: 28
Provided by: 4518
Category:

less

Transcript and Presenter's Notes

Title: 3. ???????????????????Access???(????.mdb)


1
???? ?????????
???? 1. ???????????????? 2.
?????????????(?),???????????????? 3.
???????????????????Access???(????.mdb) 4.
?????????????????????
2
17-1 VB????
17-1-1 ???????
??????,????????????????,??????????????????????
???
??????????
3
(No Transcript)
4
1. ??(?) ???????,??????????,?????????????(Tabl
e)? 2.  ??(?) ??????????????,???????????(Record),
3.  ??(?) ??????????????(Field),?????????,?????,??
??????? 4.  ?? ????????????????????????(Primary
Key)??????????????,????????????????????
5
5.?? ????????????,???????????????,??????????
???,???????????????????????????????????

6
17-2 ?????????
17-2-1 ?????
  • VB????????????,???
  • ????????
  • ??????(DAO)

1????????? ?????????????????Access???(????.mdb
),???Access?????????VB???,????????????????????
,????????????????????
7
2? ?????
???????????????
8
(1)????????????????????????(????Microsoft
Access,??7.0 MDB)?,????13-4???????
?13-4 ????????
(2)?????????????????,???????(???????MDB)??????,???
??13-5???????????
9
?13-5 ???????
(3)???????,??????????????,????13-6?????????
?
10
??????
(4)?????????????,????????,??????13-7????????
????????,??????(Text????????????)????????????????,
???????
11
???????
3.  ???? ???????????????,????????(??13-8??)???
???,???????,??????????????????
12
??????? ?????
13
17-2-2 ????????
????13-10?????????
???? ???? ???? ???? ???? ???? ????
14
17-3 ?????????
17-3-1 ADO????
ADO?????ActiveX????,??????????Data????,?????Mi
crosoft ActiveX????(ADO)???????????,????OLEDB????
???????ADO????????????????????????,??????????????
??,??OLE DB??(MDL),??ODBC?????(DSN)????DSN?,??????
????????

15
  • ??ADO????
  • 1.ConnectionStrng??
  • ConnectionString?????????????????????ConnectionStr
    ing????4????????
  • ConnectionString????

?? ??
Provide ????????
FileName ????????????
RemoteProvide ????????????????????????
Remote Server ????????????????????????
16
2.RecordSource?? RecordSource??????????,?????????
??Recordset?????????????????,??????,??????SQL?????
????????
17
17-3-2 ??????
??ADO???????,Visual Basic
6.0????????????????,??????????????????????????????
?DataGride?DataCombo?DataLiSt?DataReport?MonthView
???? ?????????DataSource?DataField????????
????,????DataMember?DataFormat???????????????DataM
ember???????????,DataFormat????????????????
18

17-3-3 ??????? 1?Refresh?? 2????? 17-4
???????(RecordSet) ??Recordset?????????????? ????
? . Recordset . ??/??
19
  • ?????Recordset???
  • BOF????????????????
  • EOF????????????????
  • Absoluteposition???????????
  • RecordCount????Recordset??????????
  • Fields????Field?????Recordset????,?????????Fidlds
    ??????Field??,??????????????(???0??),????????
  • ?Fields(1),Fields(2)?Fields(??)?

20
  • ????Recordset?????????????
  • (1) Move??
  • ??Move??????????????Move???
  • MoveFirst?MoveLast???????????????
  • MoveNext?MovePrevious??????????????
  • Move n ????????n???,n???????
  • (2) Find??
  • ?????Dynaset?Snapshot???Recordset???????????
    ??????,??????????4?Find???
  • FindFirst? FindLast??.
    ??????????????????
  • FindNext?FindPrevious???????????????????
  • 4?Find?????????
  • ????.Find?? ??

21
  • (3) Seek??
  • ??Seek????Table???????????????????,???????????????
    ?
  • ?????.Seek comparison , key1,key2
  • (4) Refresh??
  • ??????????????????????????,??RecordSource????????
    ,???????????Refresh???????????
  • Data1.DatabaseName "C\VB\Biblio.mdb"
  • Data1.RecordSource "Titles"
  • Data1.Refresh
  • (5) Close??
  • ????????????????????????????
  • ??.Close

22
  • (6)AddNew??
  • ??????????????
  • ??,??AddNew??,????????
  • ??,??????????????
  • ??,????????????,??????,???UpdateRecord?????????
  • (7)Delete??
  • ?????????????
  • ??,??????????????
  • ??,??Delete??
  • ??,??????,?????????
  • (8)?????Update??
  • ?? Adodc1.recordset.Update

23
17-5 ????
  • ????????
  • ??DataGrid?????????-- ??????Microsoft Data
    Control 6.0 ????
  • DataGrid??????DataSource

24
?????????(Data Environment) ???????(Data
Environment)?????????????.dsr???? 1?????????????
???? Data Environment??? 2??????? ??Connect
ion??,?????????????????,?????????Microsoft
jet 4.0 OLE DB Provider??????????????????
?---???? 3????? (1)??Connection??,???????????
????????? (2)???????Command???? (3)??Command??,?
?????,????? 4??????? ??????,? Command???Data
Environment????????????
25
  • ??????
  • (?)?????
  • ?DataReport???Section???Data Report?????
  • 1? DataReport??
  • ??????Data Report???
  • DataReport??????????????????????????
  • 2? Section??
  • ????????????Section????
  • Section1 Section5?
  • 3? Data Report???TextBox???Label???Image???Line??
    ?Shape???Function???

26
(?)???? 1?????? ??????(Data Environment)????? 2?
?????????????? ????Data Report?? 3???Data
Report???? DataSource?DataMember 4????? ??????
??????? 5????? 6????? 7?????????

27
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com