海贼王贝鲁梅伯图片:asp显示空白,这是为什么
来源:百度文库 编辑:神马品牌网 时间:2024/05/17 01:41:58
源代码如下,显示出来却是空白的,不知哪里错了:
<table width="484" border="0" cellspacing="2" cellpadding="0">
<!-- #include file="conn.asp" -->
<%
sql="select top 3 * from tb_shop"
rs.open sql,conn
while not rs.Eof
%>
<tr>
<td>【<% =rs("name")%>】</td>
</tr>
<%
rs.movenext
wend
set rs=nothing
conn.close
set conn=nothing
%>
</table>
请高手线我看看,谢谢.
<table width="484" border="0" cellspacing="2" cellpadding="0">
<!-- #include file="conn.asp" -->
<%
sql="select top 3 * from tb_shop"
rs.open sql,conn
while not rs.Eof
%>
<tr>
<td>【<% =rs("name")%>】</td>
</tr>
<%
rs.movenext
wend
set rs=nothing
conn.close
set conn=nothing
%>
</table>
请高手线我看看,谢谢.
在while not rs.eof这前加一句
if rs.eof and rs.bof then
response.write "没有记录!"
end if
你就知道为什么了!
<%
sql="select top 3 * from tb_shop"
rs.open sql,conn
while not rs.Eof
%>
应该这样
<%
sql="select top 3 * from tb_shop"
rs.open sql,conn,1,1
while not rs.Eof
%>
数据库里的表没有记录