Asynchronous Stored Procedure Call - Issues! - Programmers Heaven

Howdy, Stranger!

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


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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


  • bagles1bagles1 Posts: 54Member
    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.