Quote from aspfaq.com (#2194)
How do I prevent my ASP pages from waiting for backend activity?
4,334 requests - last updated Wednesday, August 14, 2002
If you are trying to run an executable or other backend process, see Adrian
Forbes' article:
Executing long-running tasks from ASP (invalid link of
http://www.aspfree.com/authors/adrian/aspexe.asp)
If you are trying to run long-running database tasks, then the following is
designed for a very specific scenario. Your
ASP page should:
1. initiate a long-running command that may cause a browser to time out;
and,
2. not need to show a user results from the command.
This means it should be a page which triggers an event in the database which
is NOT a recordset or other resultsobtainin g
operation, and that the user isn't expecting direct feedback of any kind to
let them know that the process
has finished.
<%
set conn = server.createob ject("ADODB.Con nection")
conn.open "<connectio n string>"
conn.execute "<long-running command>",,&H00 000010
response.write "The command is still running, but I'm not waiting!"
....
%>
You can test this technique by creating a single-column table:
CREATE TABLE dt (dt DATETIME)
And using a command like:
<%
set conn = server.createob ject("ADODB.Con nection")
conn.open "<connectio n string>"
sql = "INSERT dt VALUES(CURRENT_ TIMESTAMP) WAITFOR DELAY '00:00:05' " &_
" INSERT dt VALUES(CURRENT_ TIMESTAMP) WAITFOR DELAY '00:00:05' " &_
" INSERT dt VALUES(CURRENT_ TIMESTAMP)"
response.write now()
conn.execute sql,,&H00000010
'...
%>
Now wait at least 10 seconds, go into the dt table manually, and check out
the differences in the dt column (and
compare to the now() value that you wrote to the browser).
One word of warning: errors get swallowed up by the provider when using
asynchronous methods, so you'll want to
employ this method carefully.
-----------
Ray at work
"Bob Murdoch" <ra***********@ erols.com> wrote in message
news:uv******** ******@TK2MSFTN GP12.phx.gbl...
I'm developing an intranet application using W2k server and IE5.5 - 6.x
clients. I've got one particular function that calls a stored procedure
to update a number of records, depending on user input. The problem we have
run into is that this procedure can take a few minutes to complete in
certain circumstances, and of course IIS times out.
I've been doing some searching for a solution, but most of the answers
I've found relate to showing a 'Please wait' message while processing the page,
which doesn't help in this situation. The others I've found relate to
using MSMQ, which would probably help, but leads to a load of testing issues
that I'm not prepared to deal with at the moment.
Are there any other 'common' ways to handle this at the ASP level?
tia,
Bob M..