PRB: Cannot Access a Stored Procedure's Return Value from DTCID: Q190762
|
A Recordset design-time control (DTC) is bound to a stored procedure, which
returns a value, but no recordset. When the return value is accessed, this
error occurs:
ADODB.Recordset error '800a0e78'
The operation requested by the application is not allowed if the object is closed.
/<Web name>/_ScriptLibrary/Recordset.ASP, line 762
The stored procedure must return a recordset in order for the Recordset DTC to access the return value.
set DE = server.createobject("DERuntime.DERuntime")
DE.init Application("DE")
Set cmd = DE.Commands("Command1")
Set ps = cmd.Parameters
' Uncomment the following lines to provide parameters
' for the stored procedure. Use appropriate values.
' ps(1) = param1
' ps(2) = param2
cmd.execute
retval = ps(0)
This behavior is by design. The Recordset DTC was designed to work with recordsets.
Create Procedure JustReturns
As
return 23
Response.Write "Return Value = ["
Response.Write Recordset1.getParameter( 0 )
Response.Write "]"
This produces an error:
ADODB.Recordset error '800a0e78'
The operation requested by the application is not allowed
if the object is closed.
/<Web name>/_ScriptLibrary/Recordset.ASP, line 762
Additional query words:
Keywords : kbASP kbCtrl kbVisID kbVisID600 kbGrpASP
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: May 24, 1999