解剖女尸类型电影:请大家帮帮忙。

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/18 22:26:35
它应该是显示数据库的内容,但是不知道为什么既不报错也没有任何显示呢

以下是代码,希望各位老大帮帮忙!!谢谢!!

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<%
set conn=server.createobject("adodb.connection")
conn.open "driver={microsoft access driver (*.mdb)};dbq="&server.mappath("link.mdb")
%>

<body>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><div align="center">请你留言</div></td>
</tr>
</table>
<br>
<%
sql="select * from say order by id desc"
Dim rootRs
Set rootRs=Server.CreateObject("adodb.Recordset")
rootRs.Open sql,conn,1,1
If rootRs.Bof Or rootRs.Eof Then
Response.Write "目前还没有留言。"
Else
rootRs.pagesize=10
rootRs.AbsolutePage=1
If Request("page")<>"" Then
rootRs.AbsolutePage=Request("page")
RowCount=rootRs.pagesize
If Not rootRs.Eof Then
%>
<table width="500" border="1" cellspacing="1" cellpadding="0">
<tr>
<td>
<%Do While Not RootRs.Eof And RowCount>0%>
姓名:<%=rootRs("Username")%><br>
信箱:<%=rootRs("Email")%><br>
主页:<%=rootRs("url")%><br>
时间:<font.size=2><%=rootRs("Time")%></font><br>
主题:<%=rootRs("Subject")%><br>
内容:<%=rootRs("Note")%>
<p>-------------------------------------</p>
</td>
</tr>
<tr>
<td>
<%rootRs.MoveNext
RowCount=RowCount-1
Loop%>
</td>
</tr>
</table>
<%
End If
If rootRs.pagecount>1 Then
Response.Write"<b>帖子分页:</b>"
For i=1 To rootRs.pagecount
Response.Write"<a href='show.asp?page="&i&"'>"
Respones.Write"[<b>"&i&"</b>]</a>"
Next
End If
End If
End If
rootRs.close
Set RootRs=Nothing
conn.close
Set coon=Nothing
%>
</p>
</body>
</html>
Aleaf_com 你好
那个End if不能去,去掉后显示缺少End.我按你说的作了,又有新的问题了。 我设置的pagesize=10.当纪录超过10个时。错误提示为:Microsoft VBScript 运行时错误 (0x800A01A8)
缺少对象: ''
/g888g0212/liuyanban/show.asp, 第 59 行
也就是这行:Respones.Write"[<b>"&i&"</b>]</a>"
你再帮我看看吧

你有没有注意到--当执行到这一句时:
If Request("page")<>"" Then
...
会怎么样???你调试的时候,网址后面有没有加上
"?page=1"来传入page的request ??若没有的话当然就什么都不会显示咯!!!

请把:
If Request("page")<>"" Then
rootRs.AbsolutePage=Request("page")

这两行换成:
If Request("page")<>"" Then
rootRs.AbsolutePage=Cint(Request("page"))
else
rootRs.AbsolutePage=1
End if
同时后面有三个连续的"End if" 去掉一个!
这就是问题的原因!!

另外:
If Not rootRs.Eof Then
这句是废话!因为你前面已经作了判断了,所以可以把这句去掉!同时再把后面与其对应的"End If" 去掉!---->
即:
....
<%
End If
If rootRs.pagecount>1 Then
....
这个地方的"End If"去掉!!

*******************************
补充:
有没有看到你写错字啦:
Respones.Write"[<b>"&i&"</b>]</a>"
中的"Respones";
还有:
Set coon=Nothing
中的"coon";
!
当然会缺少对象啦!!!!
不行再加QQ----82269326
或到http://www.aleaf.com/gbook/ 留言啦!

看看是不是程序连接间出了问题!