?? ADO???? - PowerPoint PPT Presentation

1 / 21
About This Presentation
Title:

?? ADO????

Description:

Title: PowerPoint Presentation Last modified by: User Created Date: 1/1/1601 12:00:00 AM Document presentation format: Other titles – PowerPoint PPT presentation

Number of Views:80
Avg rating:3.0/5.0
Slides: 22
Provided by: jkyGxnuEd
Category:

less

Transcript and Presenter's Notes

Title: ?? ADO????


1
?? ADO????
2
????
  • ????ADO?????,?????ASP?????ADO????
  • ??ADO???Connection?RecordSet?Command????
  • ??????SQL??????????????????????

3
??????????
  • ODBCOpen DataBase Connection???????
  • OLE-DB?ODBC???,???,???????,???
  • ADO????,?OLE-DB???,???,??????????????????????????

4
ADO??
  • ADO????Connection?Command?Parameter?RecordSet?Fiel
    d?Property?Error??????Fields?Properties?Parameters
    ?Errors????????????,???????
  • Connection?????????????????????
  • Command????????SQL??,????????
  • Parameter???Parameters?????Command???????SQL????
    ?
  • RecordSet??????????????,????????
  • Field???Field???????RecordSet???????????????????
    ?
  • Property???Properties????????????,?Connection?Co
    mmand?RecordSet?Field?????
  • Error???Errors??????????????????
  • ??????Connection?RecordSet?Field?Command?
    ??

5
Connection??
  • ?????????????????Connection???????????????????????
    ,???????????

6
Connection????????
7
Connection?????
8
???????
  • OLE-DB??????ADO???ConnectionString??
  • ??MS Access???????
  • set connServer.createobject("ADODB.Connection")
  • conn.connectionstringProviderMicrosoft.Jet.OLE
    DB.4.0Data Source Server.Mappath("student.mdb
    ")
  • conn.open
  • '???student.mdb???

9
Connection??????
  • ?????OLympic.html
  • ????Access???olympic.mdb
  • ????????games
  • ?????????gl.asp
  • ????????,????,????

10
RecordSet??
  • RecordSet???????????????????????,?????????
  • ??RecordSet???????????????????,?????SQL?????????

11
RecordSet?????
12
RecordSet?????
13
RecordSet??????
  • ?????????,???RecordSet??,????open????RecordSet??
  • '????
  • set connServer.createobject("ADODB.Connection")
  • conn.connectionstring"ProviderMicrosoft.Jet.O
    LEDB.4.0Data Source" Server.Mappath("olympic.m
    db")
  • conn.open
  • '??Recordset??
  • set rsServer.createobject("ADODB.Recordset")
  • sqlstr"select from games"
  • rs.open sqlstr,conn

14
???????
15
RecordSet??????
  • ??1??????????
  • ????rfields.asp
  • ??2??????
  • ????move.asp

16
?????????
  • (1)adOpenFowardOnly??????0(???),?????????????????
    ??,????????Adovbs.inc??
  • (2)adOpenKeyset??????1,??????????????????????????
    ???,??????????????,??????????????,?????????????
  • (3)adOpenDynamic??????2,??????,??????????????????
    ???????????????????????
  • (4)adOpenStatic???????3,??????,?????????????????,?
    ??????????????????????

17
Command??
Connection?????????????????, Recordset???????????
???????????,Command??????????????SQL???????? ???C
ommand??,???????????????SQL???????,?????????
(1)??SQL?Select??,??????,????????Recordset???? Se
t rs Conn.Execute(Select??)
(2)??SQL?Insert?Delete?Update??,??????? Conn.Exec
ute SQL??????? (3)???Recordset??,???SQL??? Se
t rs Server.CreateObject("ADODB.Recordset") rs.
Open SQL??,Conn
18
Command??
??,????????Connection?????SQL??,??????????
Recordset?????SQL?????,??Command?????????SQL???
Command???SQL??????????????,?????????SQL????
??????,??????????SQL??,??????????????(?????,???SQL
??)???Command????SQL?Select???,???Recordset???????
?????,??????????????,??????Recordset???Open???????
?? ??Command?????? Set Command???
Server.CreateObject("ADODB. Command")
19
Command????????
20
Command???????
21
??Command??
  • ??Command?????SQL ??,??adocmd.asp?
Write a Comment
User Comments (0)
About PowerShow.com