asp显示空白,这是为什么

来源:百度知道 编辑:UC知道 时间:2024/04/28 07:46:09
源代码如下,显示出来却是空白的,不知哪里错了:
<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
%>

数据库里的表没有记录