I am working on an old asp project. I am new in project. My question is,
I required to execute the certain number of pages in a specific time but when I put in a loop to execute the page for certain pattern it execute only one pattern and shows time out expired problem. Though I searched in net what ever answer I get it will not fulfill my requirement. So my team lead said we have to find out some thing that can execute my page for 3 min each then it call back freshly. Is there any me开发者_开发问答thod is there in asp. as I am new in asp. as it possible or share some idea.
I want to execute for each pattern. Here is my simple code.
dim arrList()
dim mySQL,x,strPtrn
mySQL=""
x=0
strPtrn=""
mySQL="select distinct(pattern_no) from pattern_master where std between (dateadd(hh,8,getdate())) and (dateadd(hh,11,getdate()))"
set rstptrnmst= conn.Execute(mySQL)
do until rstptrnmst.EOF
for each ptrn in rstptrnmst.Fields
' Response.Write(x.name)
'Response.Write(" = ")
'Response.Write(x.value & "<br />")
ReDim Preserve arrList(x)
arrList(x)=ptrn.value
x=x+1
next
Response.Write("<br />")
rstptrnmst.MoveNext
loop
rstptrnmst.close
conn.close
'for each ptrn in arrList
'response.Write("<br>" & ptrn)
'next
for each ptrn in arrList
Session("pattern")=ptrn
server.Execute("processFNO.asp")
Session("pattern")=""
response.write("The first pattern " & ptrn & "<br />")
next
'Response.Redirect("processFNO.asp?fno="&arrList(0))
%>
So I want execute that page for each pattern. How can I? For each pattern it take 3 min(approx).any idea?
thanks for advance.
If your script is going to take that long to run you will need to set the script timeout option to cater for that:
<%
Server.ScriptTimeout = 180
%>
The timeout is set in seconds, with the default being 90. You should set this at the very top of your page.
More information about timeouts here: How do I increase timeout values
精彩评论