ASP显示无数据

来源:百度知道 编辑:UC知道 时间:2024/06/22 05:21:29
response.write("<table width=513 height=20><tr><td width=270 align=center height=25><a href='#' onclick=javascript:window.open('show.asp?id="&rs("id")&"','stuview','top=0,left=100,width=700,height=650,ToolBar=no,Location=no,MenuBar=no, Status=no,Scrollbars=yes');>"&rs("title")&"</a></td><td align=center>#"&rs("time")&"#</td></tr></table>")
这是一段显示结果的代码,请问为什么运行时无数据,表里是有数据的,谢谢!
还是什么都没有,我把整段代码放上去,知道的麻烦的告诉我,谢谢!
<% dim rs,sql
set rs=server.CreateObject("adodb.recordset")
sql="select * from bbs order by time desc"
rs.open sql,conn,1,1
if rs.eof then
response.Write("没有日记哦!")
do while not rs.eof and page>0
'这里就是上面那段代码 rs.movenext
loop end if
rs.movefirst
response.write "<br><table width=49

你这条语句,太长了,把语句缩短一点再试
我结你把表格加个框。

用排除法,
先输出简单的表格,看有没有输出
response.write ("<table width=513 height=20 border=1 bordercolor=red <tr><td >jj</td></tr></table")

把jj,换成你那语句里最精间的代码,

如果有输出结果,再把精简的代码换成更长代码.

没读到数据 这点代码找不出原因

if rs.eof then
response.Write("没有日记哦!")
do while not rs.eof and page>0

改为

if rs.eof then
response.Write("没有日记哦!")
else
do while not rs.eof and page>0

增加个else. 完整代码如下

<% dim rs,sql
set rs=server.CreateObject("adodb.recordset")
sql="select * from bbs order by time desc"
rs.open sql,conn,1,1
if rs.eof then
response.Write("没有日记哦!")
else
do while not rs.eof and page>0
response.write("<table width=513 height=20><tr><td width=270 align=center height=25><a href='#' onclic