日期:2014-05-17  浏览次数:20767 次

请大师指点Server.ScriptTimeOut 超时问题,无限感谢!
我有几千门课程安排,要运行几个小时,但运行1小时左右就出现以下错误码,请指点!

出错信息:

Active   Server   Pages   错误   'ASP   0113 '  

脚本超时  

/jiaoshi/paike/sjbj/psjautoall.asp  

超过了脚本运行的最长时间。可以为   Server.ScriptTimeOut   属性指定新值或更改   IIS   管理工具中的相应值来更改此限制。  


以下是psjautoall.asp文件内容:

<%server.ScriptTimeout=36000
Response.Buffer=false%>
<!--#include   file= "../../../conn/conn.asp "-->
<!--#include   file= "../../../pwd/paikepwd.asp "-->
<!--#include   file= "pauto.asp "-->
<html>
<head>
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<title> 排课 </title>
<link   rel= "stylesheet "   type= "text/css "   href= "../common/css/style.css ">
</head>
<body   topmargin=0   leftmargin=0>
<%xueqi=session( "xueqi ")%>
 
<%
conn.commandtimeout=60000

  sql= "select   *   from   开课任务   where     学期= ' "&xueqi& " '   and   是否排课= '是 '   and   是否锁定= '否 '   and     周学时> 已排周学时     order   by   排课等级   desc,   周学时   desc "
set   rsb=server.createobject( "adodb.recordset ")
rsb.open   sql,conn,1,3
      rowbj=1
  do   while   not   rsb.eof  
response.write     " <font   color=orange> 第 "&rowbj& "门, "&rsb( "班级 ")&rsb( "课程 ")& "! <br> </font> "
id=rsb( "id ")  

pauto     id

%>

<%rsb.movenext
rowbj=rowbj+1
loop

Response.Write   "全校课程已经全部安排! <br> "
Response.Write   " <a     href= 'psjview.asp '> 返回 </a> "
Response.End    
  %>


------解决方案--------------------
1. 考虑 数据库是否有建立有效的索引? 似乎几个小时太长了。
2. 如果真的要这么长时间,考虑在服务器端用vbs写脚本执行,代码和asp的基本一样。