Good evening
I'm trying to execute a stored procedure which will take in a bunch of values as variables. Everything's working as expected so far, but I need to know how I would go about getting the value that the Stored Proc is returning when it's complete.
The procedure in question is creating a new record in a database table, and returning the identity value. However I can't get my head around how to capture that identity value so that it can be presented to the end user.
The code that I'm using is as follows:
Set SQLDB=Server.CreateObject("ADODB.Connection")
SQLDB.Open Session("ODBC")
If Request.QueryString("Action") = "New" THEN
NewSystemName = "'" & Request.Form("Field_SystemName") & "'"
NewControlURL = "'" & Request.Form("Field_ControlURL") & "'"
If Request.Form("Field_Visible") = "on" THEN
NewVisible = 1
ELSE
NewVisible = 0
END IF
cmd = "exec dbo.ihsp_Dashboard_Admin_AddSystems " & NewSystemName & ", " & NewControlURL & ", " & NewVisible & ", '" & Session("Username") & "'"
SQLDB.Execute(cmd)
END IF
After the SQLDB.Execute(cmd) line, I would expect to put something in there to interrogate the command and retrieve the return value. However everything I've tried has been unsuccessful. However, the Stored Procedure is working inasmuch as a new record is being created.
TIA




Reply With Quote
