超简单但怎么也取不出数据sql

来源:百度知道 编辑:UC知道 时间:2024/05/31 04:04:08
'注conn已经打开
content =""
set rs = conn.execute("select top 1 * from account ")
response.Write ("select top 1 * from account ")
if not rs.eof then
response.Write "<br>this is here <br>" content = rs("id")
response.Write "<br>this is here2 <br>"
response.Write "<br>content ="&content '此句不执行表里有数据,sql在查询分析器执行通过
end if
不好意思上面代码写错了
原代码如下:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<% noCheck="true"%>
<!--#include file = "admin_fm/inc/conn.asp"-->
<body >
<%
ctype = request("type")
content = ""
if isnumeric(ctype) and ctype>0 then
ctype=int(ctype)
else
ctype=0
end if

set rs = conn.execute("select top 1 * f

response.Write "content ="&content改成
response.Write "content ="+ rs("id")
试下

id这个字段是不是没内容啊,换换account 表中的其他字段试试

可能 ID这个字段里面是空的 或者只有一个空格~