一個(gè)基于web的QQ程序 2(xml+asp)
發(fā)表時(shí)間:2024-06-21 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]用于處理xmlhttp請(qǐng)求的asp程序,看看時(shí)不是很簡單。??=====<%on error resume nextResponse.ContentType="text/xml" if Request.ServerVariables("REQUEST_M...
用于處理xmlhttp請(qǐng)求的asp程序,看看時(shí)不是很簡單。??
=====
<%on error resume next
Response.ContentType="text/xml"
if Request.ServerVariables("REQUEST_METHOD")="POST" then
set req=Server.CreateObject("Microsoft.XMLDOM")
req.async=false
req.load(Request)
set conn=server.CreateObject("adodb.connection")
conn.Open "odbc","uid","password"
sql="select uid,id,sex from uidinfo order by id desc"
set rs=server.CreateObject("adodb.recordset")
rs.Open sql,conn
Response.Write "<?xml version=""1.0"" ?>"
Response.Write "<mess>"
if not rs.EOF then
do while not rs.EOF
Response.Write "<id>"&trim(rs("id"))&"</id><uid>"&trim(rs("uid"))&"</uid><sex>"&trim(rs
("sex"))&"</sex>"
rs.MoveNext
loop
else
Response.Write "<id>k</id><uid></uid><sex></sex>"
end if
Response.Write "</mess>"
if rs.State=1 then rs.Close
set rs=nothing
conn.Close
set conn=nothing
set req=nothing
end if
%>