execute stored procedure asynchronously

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I'm trying to asynchronously execute a stored procedure against SQL Server
from a VB6 client application and can't seem to make it work. The error I'm
getting is: "Operation cannot be performed while connecting asynchronously".
If I remove the "adAsyncConnect" option from the connection string, the
procedure runs fine-

Here is my sample db connection code:

sConnString = "Provider=SQLOLEDB;Data Source=myServer;Initial
Catalog=myDatabase"
conn.Open sConnString, "username", "password", adAsyncConnect

cmd.CommandType = adCmdStoredProc
cmd.CommandText = "spMyStoredProcedure"
cmd.Parameters.Append cmd.CreateParameter("param1", adVarChar, adParamInput,
36, param1)
cmd.Parameters.Append cmd.CreateParameter("param2", adSmallInt,
adParamInput, , param2)
cmd.Execute


tia!

JTL


.



Relevant Pages

  • RE: SSIS Exec SQL Task Output Parm Value Not Updating Package Vari
    ... Instead of using an OUTPUT parameter in the sp, set the Execute SQL Task (on ... With stored procedures, the other connection ... listed in the stored procedure, which makes the connection a little more ... I've created a Master Package that will be used as a template for developing ...
    (microsoft.public.sqlserver.dts)
  • RE: SSIS Exec SQL Task Output Parm Value Not Updating Package Variable
    ... With stored procedures, the other connection ... listed in the stored procedure, which makes the connection a little more ... I've created a Master Package that will be used as a template for developing ... At the end of the process, the created audit record will be ...
    (microsoft.public.sqlserver.dts)
  • RE: MS Query "Connections"
    ... handle that with my connection string. ... for using the stored procedure route is that it is faster. ... If you truly want to pass in the query string, ...
    (microsoft.public.excel.programming)
  • Re: How to navigate recursive stored procedures results
    ... connection is inherited by the next user, ... beforehand so any residual #Temp tables would be dropped. ... the identity is not "flow"ing to the SQL Server - ... union a SQL query and the results of a stored procedure. ...
    (microsoft.public.dotnet.framework.adonet)
  • Re: Really tough ADO Stored Procedure Question. Please Help!!!
    ... Check to be sure you are connecting to the database via VB using the SAME ... Connection Objectss "Errors CVollection" in your VB. ... > Stored Procedure: (All this is in one stored procedure but this is the ... > in a #Temp2. ...
    (microsoft.public.sqlserver.programming)