| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 550 人关注过本帖
标题:不知道哪里出了问题(急)请大家帮忙看看
只看楼主 加入收藏
流星阿勇
Rank: 1
等 级:新手上路
帖 子:75
专家分:0
注 册:2007-4-1
收藏
 问题点数:0 回复次数:3 
不知道哪里出了问题(急)请大家帮忙看看

运行之后就出现下面的错误:

错误类型:
Active Server Pages, ASP 0113 (0x80004005)
超过了脚本运行的最长时间。可以为 Server.ScriptTimeOut 属性指定新值或更改 IIS 管理工具中的相应值来更改此限制。
/myweb/blog.asp





<html>
<head>

<title>留言薄</title>
</head>
<style type="text/css">
<!--
A:link,
A:visited{text-decoration:none;color:#008040}
A:hover{text-decoration:underline;color:#ff0000}
-->
</style>
<%
Function Deal(expl)
dim exp2
exp2=Replace(exp2,"<","&lt;")
exp2=Replace(exp2,">","&gt;")
exp2=Replace(exp2,"'","")
exp2=Replace(exp2,"chr(13)","<br>")
Deal=exp2
End Function
'建立与数据库的链接

dim conn
dim connstr
on error resume next
set conn=server.createobject("ADODB.CONNECTION")
connstr="DBQ="+server.mappath("blog.mdb")+";DefaultDir=;DRIVER={Microsoft Access Driver (*.mdb)};"
'driverId=25;FIL=MS
'ACCESS;ImplicitCommitSync=Yes;MaxBufferSize=512M;MaxScanRows=8;PageTimeout=5;SafeTransactions=0;Threads=3;UserCommitSync=Yes;"
conn.open connstr


if request("task")="insert" then
if request("xm")=""then
xm="不告诉你"
else
xm=request("xm")
xm=Deal(xm)
end if

if request("email")="" then
email="不没有呢"
email=Deal(email)
else
email=request("email")
email=Deal(email)
end if

if request("url")="" then
url="没有"
else
url=request("url")
url=Deal(url)
end if

sj=date()
sj=sj & "" & hour(time())&":"&Minute(time())
if request("ly")=""then
response.write("请输入留言")
response.end
ly=request("ly")
ly=Deal(ly)
end if
sql="insert into lyb(ip,xm,url,email,sj,ly)values('"
sql=sql&request("remote_addr")&"','"&xm&"','"&url&"','"&email&"','"&sj&"','"&ly&"')"
conn.execute(sql)

end if

set rs=server.createobject("adodb.recordset")
on error resume next
rs.open "select from lyb order by sj desc",conn,1,1
rs.pagesize=15
rs.absolutepage=1
if request("page")<>"" then
rs.absolutepage=request("page")
RowCount=rs.pagesize
end if

%>

<body>
<p>
<strong><big><big><big>留言薄</big></big></big></strong>
</p>
<form method="post" action="<%=request("script_name")%>">
<input type="hidden" name="task" value="insert"><p>
姓名:<input type="text" name="xm" size="20"> <br>
邮件:<input type="text" name="eamil" size="20"><br>
主页:<input type="text" name="url" size="20" ><br>
留言:<br>
<textarea rows="5" cols="60" name="ly">
</textarea></p>
<p><input type="submit" value="记入留言薄" name="b1" >
<input type="reset" value="重写" name="b2">

</form>
<hr>
<%
if not rs.eof then
do while not rs.eof and RowCount>0
%>
<p>日期:<%=rs("sj")%> <br>
<%
if rs("xm")<>"" then
%>
姓名:<%=rs("xm")%><br>
<%
end if
if rs("url")<>"" then
%>
主页:<a href="<%=rs("url")%>"><%=rs("url")%></a><br>
<%
end if
if rs("email")<>"" then
%>
邮箱:<a href="mailto:<%=rs("email")%>"><%=rs("email")%></a><br>
<%end if%>
留言:<br>
<%=rs("ly")%></p>
<hr>
<%
RowCount=RowCount-1
rs.movenext
loop
else
response.Write("留言薄空")
end if

%>
<%
if rs.pagecount>1 then
%>
<table border="0">
<tr>
<td>留言分页</td>
<%
for i=1 to rs.pagecount
%>
<td>
<a href="<%=request("script_name")%>?page=<%=i%>"><b><%=i%></b></a>
</td>
<%
next
%>
</tr>
</table>
<%
end if
rs.close
set rs=nothing
conn.close
set conn=nothing

%>

</body>
</html>


[此贴子已经被作者于2007-5-13 9:28:59编辑过]

搜索更多相关主题的帖子: 管理工具 style link 时间 留言 
2007-05-13 09:27
阳光白雪
Rank: 7Rank: 7Rank: 7
等 级:贵宾
威 望:39
帖 子:2220
专家分:0
注 册:2005-11-18
收藏
得分:0 

估计是形成了死循环:

do while not rs.eof and RowCount>0

看看这个条件有没有什么问题


专注于WEB前端交互平台开发:[url=http://blog./]blog.[/url](富客户端技术(RIA)交流平台)
2007-05-13 10:44
流星阿勇
Rank: 1
等 级:新手上路
帖 子:75
专家分:0
注 册:2007-4-1
收藏
得分:0 

把and RowCount>0这个条件去掉还是一样。。。。


我是菜鸟,但我会一直努力。。。相信总有一天会成功。。。
2007-05-13 11:12
流星阿勇
Rank: 1
等 级:新手上路
帖 子:75
专家分:0
注 册:2007-4-1
收藏
得分:0 

我把这段代码去掉就好。。。帮我看看是哪块出现了死循环?

<%
if not rs.eof then
do while not rs.eof
%>
<p>日期:<%=rs("sj")%> <br>
<%
if rs("xm")<>"" then
%>
姓名:<%=rs("xm")%><br>
<%
end if
if rs("url")<>"" then
%>
主页:<a href="<%=rs("url")%>"><%=rs("url")%></a><br>
<%
end if
if rs("email")<>"" then
%>
邮箱:<a href="
mailto:<%=rs("email")%>"><%=rs("email")%></a><br>
<%
end if
%>
<%

%>
留言:<br>
<%=rs("ly")%></p>
<hr>
<%
RowCount=RowCount-1
rs.movenext
loop
else
response.Write("留言薄空")
end if

%>
<%
if rs.pagecount>1 then
%>
<table border="0">
<tr>
<td>留言分页</td>
<%
for i=1 to rs.pagecount
%>
<td>
<a href="<%=request("script_name")%>?page=<%=i%>"><b><%=i%></b></a>
</td>
<%
next
%>
</tr>
</table>
<%
end if
rs.close
set rs=nothing
conn.close
set conn=nothing

%>


我是菜鸟,但我会一直努力。。。相信总有一天会成功。。。
2007-05-13 11:47
快速回复:不知道哪里出了问题(急)请大家帮忙看看
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.015410 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved