为什么asp查数据库时空集。显示就会显示空白呢?

xwoniu 2009-12-19 11:11:16
后面的HTML也没有办法输出来了。。

<%
'批量修改所有记录
dim sql,rs
Dim count
set rs=server.createobject("adodb.recordset")
sql="select * from Tsignupinfo where swqdzt=2 or swqtzt=2 or xwqdzt=2 or xwqtzt=2"
count = 0
rs.open sql,conn,1,3
if rs.eof and rs.bof then
rsponse.write("没有记录")
end If
If rs.eof Then
count =count+1
End if

%>
<p class="center">
需要修改的记录有<%=count%>条
</p>
<form action="qd_up.asp" method="post">

<p class="center">
<input type ="submit" value="提交修改记录" size="20">
</p>
</form>
...全文
110 15 打赏 收藏 转发到动态 举报
写回复
用AI写文章
15 条回复
切换为时间正序
请发表友善的回复…
发表回复
junpu123 2009-12-25
  • 打赏
  • 举报
回复
正确了,上楼的
alianghao 2009-12-25
  • 打赏
  • 举报
回复
if rs.eof and rs.bof then
rsponse.write("没有记录")
end If
If rs.eof Then
count =count+1 //错了,
End if

改为
if rs.eof and rs.bof then
rsponse.write("没有记录")
else
count=rs.recordcount
end If
sniper1534 2009-12-25
  • 打赏
  • 举报
回复
if rs.eof then
response.write("没有记录")
count =0
else
count =rs.recordcount
end if
txneo001 2009-12-25
  • 打赏
  • 举报
回复
response写错了
「已注销」 2009-12-24
  • 打赏
  • 举报
回复
学习一下
chinank 2009-12-24
  • 打赏
  • 举报
回复
 <%
'批量修改所有记录
dim sql,rs
Dim count
set rs=server.createobject("adodb.recordset")
sql="select * from Tsignupinfo where swqdzt=2 or swqtzt=2 or xwqdzt=2 or xwqtzt=2"
count = 0
rs.open sql,conn,1,3
if rs.eof then
response.write("没有记录")
count =0
else
count =rs.recordcount
end if
rs.close

%>
<p class="center">
需要修改的记录有<%=count%>条
</p>
<form action="qd_up.asp" method="post">

<p class="center">
<input type ="submit" value="提交修改记录" size="20">
</p>
</form>

gingerkang 2009-12-24
  • 打赏
  • 举报
回复
rsponse.write==>response.write
ayouori 2009-12-24
  • 打赏
  • 举报
回复
rs.open sql,conn,1,1
count = rs.recordcount
if count = 0 then
response.write("没有记录") '楼主写的是rsponse.write
end if
ITMIBM 2009-12-23
  • 打赏
  • 举报
回复
count=rs.RecordCount 正解
yan11cn 2009-12-20
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 pilicat 的回复:]
你的代码写得有问题,请修改为下面的试试:


rs.open sql,conn,1,3
if rs.eofor rs.bofthen
rsponse.write("没有记录")Else
count=rs.RecordCount
End if

%[/Quote]

支持
yan11cn 2009-12-20
  • 打赏
  • 举报
回复
[Quote=引用 5 楼 xwoniu 的回复:]
一样的,还是不行!
[/Quote]
你在rs.open sql,conn,1,3
之后用循环输出下记录集看看 有没有正确返回要查询的记录
do while not rs.eof
response.write(rs("字段名")&"<br />")
rs.movenext
loop
xwoniu 2009-12-20
  • 打赏
  • 举报
回复
一样的,还是不行!
后浪 2009-12-19
  • 打赏
  • 举报
回复
人为
后浪 2009-12-19
  • 打赏
  • 举报
回复
你导入数据的时候可以认为加个空格&" "
pilicat 2009-12-19
  • 打赏
  • 举报
回复
你的代码写得有问题,请修改为下面的试试:


<%
'批量修改所有记录
dim sql,rs
Dim count
set rs=server.createobject("adodb.recordset")
sql="select * from Tsignupinfo where swqdzt=2 or swqtzt=2 or xwqdzt=2 or xwqtzt=2"
count = 0
rs.open sql,conn,1,3
if rs.eof or rs.bof then
rsponse.write("没有记录")
Else
count =rs.RecordCount
End if

%>
<p class="center">
需要修改的记录有<%=count%>条
</p>
<form action="qd_up.asp" method="post">

<p class="center">
<input type ="submit" value="提交修改记录" size="20">
</p>
</form>


28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧