Wrox Home  
Search P2P Archive for: Go

  Return to Index  

activex_data_objects thread: Stored procedure return values


Message #1 by "Ian Cox" <ian_cox2001@h...> on Fri, 1 Mar 2002 12:50:17 -0000
Hi all. I'm having a problem getting the return value from a stored

procedure when I am also returning a recordset.



The code below return empty in the return  value

    Set objCMD = New ADODB.Command

    With objCMD

        .CommandText = "GetStuff"

        .CommandType = adCmdStoredProc

        .ActiveConnection = strConnectString

        .Parameters.Append objCMD.CreateParameter("RETURN_VALUE", adInteger,

adParamReturnValue, 4)

        Set objRS = .Execute()



        intRowcount = .Parameters("RETURN_VALUE").Value

    End With





This code returns the correct return value



    Set objCMD = New ADODB.Command

    With objCMD

       .CommandText = "GetStuff"

        .CommandType = adCmdStoredProc

        .ActiveConnection = strConnectString

       .Parameters.Append objCMD.CreateParameter("RETURN_VALUE", adInteger,

adParamReturnValue, 4)

        objCMD.Execute



        intRowcount = .Parameters("RETURN_VALUE").Value

    End With



Is it possible to gete at the return value when you are also returning a

recordset, or am I doing something stupid?



Thanks in advance

Ian




  Return to Index