Asynchronous Stored Procedure Call - Issues!

I'm using vbScript to call a stored procedure, which takes several hours to complete. If I use cmd.Execute synchronously, the Web browser obviously times out - waiting for the stored procedure to return control to the script. I need to do this asynchronously, but I'm not able to come up with the right combination of option constants that will A) successfully run the stored procedure, and B) restore control to the browser. A snippit of my code (which accomplishes B but not A) is below - thanks in advance for any assistance.

Set cmd = Server.CreateObject("ADODB.Command")
With cmd
Set .ActiveConnection = cn
.CommandText = "gd.GET_DEPLETIONS"
.CommandType = adCmdStoredProc
.Execute , , adAsyncExecute + adExecuteNoRecords
End With


  • Maybe I am missing something here but why are you trying to run a maintenance script through ASP? If you are using Oracle or SQL Server they both have ways in which to schedule and automate the process. If it is taking several hours to do, automation should be the way in which it is done. You could also do it through a VBScript file rather than an asp file and set that to run through Windows Task Scheduler.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion