Stored Procedure Return Value

Results 1 to 2 of 2

Thread: Stored Procedure Return Value

  1. #1
    Join Date
    Dec 1969

    Default Stored Procedure Return Value

    I have a stored procedure that I am using to input form values into. The stored procedure has to output values that I need to pass to the next page. I can get all of my input values to work, but can someone tell me how to get the return values to display?

  2. #2
    Join Date
    Dec 1969

    Default RE: Stored Procedure Return Value

    I assume you&#039;re using an adodb.command object to call your procedure, something like this:<BR><BR>With objCommand<BR> .ActiveConnection = strConnString<BR> .CommandType = adCmdStoredProc<BR> .CommandText = "foobar"<BR> <BR> <BR> &#039;input parameter<BR> Set sqlParameters = .CreateParameter("@foo", adVarChar, adParamInput, 1000, strFoo)<BR> .Parameters.Append sqlParameters<BR><BR> &#039; output parameters<BR> Set sqlParameters = .CreateParameter("@bar", adInteger, adParamOutput)<BR> .Parameters.Append sqlParameters<BR> <BR> .Execute<BR> <BR> &#039; get the value of the output parameter<BR> intBar = .Parameters("@bar")<BR> End With<BR><BR>-------<BR>if you do it this way, you&#039;ll also need the parameter declared as OUTPUT in your stored procedure<BR><BR>CREATE Procedure foobar<BR> <BR> @foo varchar(1000),<BR> @bar int OUTPUT<BR><BR>AS<BR><BR> /* the body of your procedure */

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts