Multiple-step operation generated errors. Check each status value.
- From: "Karin" <Karin@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Mon, 24 Oct 2005 02:25:03 -0700
I'm working with an old DNA web project where an asp page calls a VB6 COM+
component which uses ADO to retireve an empty recordset from SQL Server 2000
via a stored procedure. The proc takes several parameters which some should
be returned directly.
Example:
CREATE PROC MyProc (
@Param1 int
,@Param2 varchar(40)
,@Param3 char(2) = 'SE'
)
AS
SELECT a.col1
,a.col2
,@Param3 AS 'Param3'
FROM table a
GO
Function GetForNew () As Variant
Dim conn As New Connection, rs As New Recordset
Dim strSQL As String
conn.CursorLocation = adUseClient
conn.ConnectionString = msConnectString
conn.CommandTimeOut = miCommandTimeout
conn.Open
strSQL = "MyProc "
' Set properties for the resultset object
rs.CursorType = adOpenKeyset
rs.LockType = adLockBatchOptimistic
' Set the resultset object based on the query object
rs.ActiveConnection = conn
rs.Open strSQL
' Return the resultset object to the calling client
Set GetForNew = rs
' Disconnect the resultset for now
Set rs.ActiveConnection = Nothing
' Closing query and connection object
conn.Close
End Function
When the proc is called and a recordset (adoRs) is created the column Param3
has property Attributes set to 112 (adoRs.Fields("Param3").Attributes) which
don't let me set any value to this column...
Public Property Let Param3(ByVal NewValue As Variant)
adoRs!Param3 = IIf(CVar(NewValue) = Empty, Null, CStr(NewValue))
End Property
If I change in the proc and puts @Param3 in a temporary table and JOIN this
new table, the Attributes property is set to 120 and I can set a value to the
column! WHY?
SELECT @Param3 AS 'Param3'
INTO #Temp
SELECT a.col1
,a.col2
,b.Param3 AS 'Param3'
FROM table a
JOIN #Temp b ON Param3 = @Param3
But it doesn't work everytime :-(
Please help!
Thanks in advance
.
- Follow-Ups:
- Re: Multiple-step operation generated errors. Check each status value.
- From: Mark J. McGinty
- Re: Multiple-step operation generated errors. Check each status value.
- Prev by Date: Re: Memory Leak with Recordset?
- Next by Date: Re: ADO recordset movement in Oracle DB
- Previous by thread: Re: Display a record by key in a form
- Next by thread: Re: Multiple-step operation generated errors. Check each status value.
- Index(es):