How do you access RETURN (0)

Results 1 to 4 of 4

Thread: How do you access RETURN (0)

  1. #1
    sql_usr Guest

    Default How do you access RETURN (0)

    I see many examples of stored procs that have<BR>RETURN (0) or<BR>RETURN (1)<BR>How do I access that value in ASP?

  2. #2
    Join Date
    Dec 1969

    Default RE: How do you access RETURN (0)

    Just set a variable equal to the stored procedure:<BR><BR>EXEC @returnValue = spDoSomething<BR><BR>Then the variable @retValue will be equal to whatever you pass to the RETURN line in your stored procedure

  3. #3
    sql_usr Guest

    Default this causes an error

    &#039;This causes an error saying:<BR> &#039;Item cannot be found in the collection corresponding <BR> &#039;to the requested name or ordinal<BR><BR> Dim cn<BR> Dim strConnect<BR> Dim strSQL<BR> Dim rs<BR> <BR> Set cn = Server.CreateObject("ADODB.Connection")<BR> strConnect = "MyConnectString..."<BR> cn.Open(strConnect)<BR> <BR> strSQL = "DECLARE @returnValue int " _<BR> & "EXEC @returnValue = spDoSomething"<BR> set rs = cn.Execute(strSQL)<BR> <BR> Response.Write rs("@returnValue")<BR> <BR> rs.Close<BR> cn.Close<BR> Set rs = Nothing<BR> Set cn = Nothing

  4. #4
    Join Date
    Dec 1969

    Default Use the ADO Command object...

    ...<BR><BR>You&#039;l l find a sample here.

Posting Permissions

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