Personally I don't think using ASP files is the best way to go about doing
this type of work. You're better off writing yourself a VB app, or a little
vbs script instead.
That said, what you could do is something like this. Have the page accept a
parameter sent via the querystring which tells it which record it was up to
in the database, so you'd start with:
DoStuff.asp?ID = 1
DoStuff processes the first 100 records. If there are more records it then
issues a Response.Redirect:
intNextRecord = "101"
Response.Redirect("DoStuff.asp?ID=" & intNextRecord)
and so on until all the records are processed, in which case it writes out
"all done". This way you can set the Server.ScriptTimeout to a smaller value
since each "page" is doing less work.
From: "Michael Bischof" <m.bischof@c...>
Subject: [proasp_codeclinic] How to use ScriptTimeout in Loops ?
: maybe someone of you can help me:
: I want to start a mail sending process and want to reset the
: Server.ScriptTimeout every time the loop starts to the value of 120
: i tried this way:
: WHILE NOT rs.EOF
: Server.ScriptTimeout = 120
: but it dont work.
: I dont want to set the default Timeout the several hours, because the
: script may hang up or something like that and then i can't access the
: script and database until this very big timeout has expired... :-(
: What can i do?
: ( Must i reload the page to reset the ScriptTimeout value? )