当前位置: 首页 > 图文教程 > 网络编程 > ASP > 一个基于web的QQ程序 2(xml+asp)

ASP
ASP编程中15个非常有用的例子 (二)
ASP与JSP的比较(一)
ASP与JSP的比较(二)
ASP中五种连接数据库的方法
从ASP调用SQL中的图像
用排序串字段实现树状结构(例程:连接字串)
用排序串字段实现树状结构(例程:删除贴子)
用排序串字段实现树状结构(例程:回复表单)
用排序串字段实现树状结构(例程:显示贴子内容)
用排序串字段实现树状结构(例程:显示树)
用排序串字段实现树状结构(存储过程)
用排序串字段实现树状结构(库结构)
用排序串字段实现树状结构(原理)
remote script文档(转载自微软)(一)
remote script文档(转载自微软)(二)
remote script文档(转载自微软)(三)
remote script文档(转载自微软)(四)
remote script文档(转载自微软)(五)
remote script文档(转载自微软)(六)
remote script文档(转载自微软)(七)

ASP 中的 一个基于web的QQ程序 2(xml+asp)


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 155 ::
收藏到网摘: n/a

  用于处理xmlhttp请求的asp程序,看看时不是很简单啊!??
=====
<%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
%>