Complete database operations with HTTPService Pseudo-Web service communication with ASP

xiaoxiao2021-03-06  66

Using HTTPService Pseudo-Web Services Communications for ASP, complete database operation I offer an ASP's pseudo-service ideology: ClientReq.xml: ---------------------------------------------------------------------------------------------- -------------------------------------------------- ----------------------- getValueReq < Version> 1.0 Index.mxml: --------------------------------- -------------------------------------------------- ------------ {mreq} TestServer.asp: -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------- --- Mainly have data packets, parsing packets, specifying operations, returning data four steps 1. Get submitted packets set = server.createObject ("msxml2.domdocument") odom.load request 2. Parsing the data packet, to obtain MsgTypesMsgType = Trim (oDom.selectSingleNode ( "// MsgType"). Text) Select Case sMsgTypeCase "GetvalueReq" Call Getvalue'Case "DeletevalueReq" 'Call DeletevalueCase "InsertvalueReq"' Call Insertvalue (oDom) 'Case " UpdateValuereq "'CALL UPDATEVALUE'ELSE CASE' CALL SHOWERRMSGEND SELECT 3.

Specify the operation, complete the getValue operation, there are many of which can be made into public modules for other functions to use sconn = "driver = {Microsoft Access Driver (* .mdb)}; dbq =" & server.mAppath ("message.mdb ") Set oconn = server.createObject (" adodb.connection ") Oconn.open sconnsql =" select * from message order by id "set = server.createObject (" adodb.recordset ") Ors.Open SSQL, Oconn, 1, 1 'Construction No record XML Document If ory = "" & VBCRLF & _ " & vbcrlf & _ SystemResp "& vbcrlf & _" 1.0 "& vbcrf & _" 0 "& vbcrlf & _" "endiff) There is a record XML document if not (ors.eof and ors.bof) Thendo while not list.eofstmpxml = stmpxml & " "& ics (" name ") &" "& VBCRLF & _" "& ORS (" Age ") &" "& VBCRLF & _" "& ORS (" SEX ") &" "& vbcrf & _ < Msg> "& ORS (" MSG ") &" "& vbrlf & _" "& VBCRLF & _ & Vbcrlf & _ " SystemResp " & vbcrlf & _ "<

转载请注明原文地址:https://www.9cbs.com/read-90389.html

New Post(0)