asp输出sql查询结果资料到浏览器上,该怎么写

来源:百度知道 编辑:UC知道 时间:2024/05/22 16:16:48
<%
set cx=server.CreateObject("adodb.recordset")
set chaxun=conn1.execute("select * from [city4] where cityid between 1085300 and 1240000")
cx.open chaxun,conn1,0,1
response.Write(cx(chaxun))
cx.close
set cx=nothing
%>

<%
set cx=server.CreateObject("adodb.recordset")
set chaxun=conn1.execute("select * from [city4] where cityid between 1085300 and 1240000")
cx.open chaxun,conn1,1,1
response.Write(cx(chaxun))
cx.close
set cx=nothing
%>

这样写:

<%
set cx=server.CreateObject("adodb.recordset")
set chaxun=conn1.execute("select * from [city4] where cityid between 1085300 and 1240000")
cx.open chaxun,conn1,1,1
response.Write(cx("chaxun"))
cx.close
set cx=nothing
%>

seensky的..因为他是记录集..输出的时候要加双引号.