运行之后就出现下面的错误:
错误类型:
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,"<","<")
exp2=Replace(exp2,">",">")
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编辑过]