I have a problem registering parameters for a stored procedure.
Please see this SP carefully.That's it, we take an input parameter of type : NUMERIC, update a value in tableCode:CREATE PROCEDURE [dbo].[proc1] @ObjectType numeric AS SET NOCOUNT ON DECLARE @ObjectID INT BEGIN TRANSACTION UPDATE tblObject SET m_lCurrentObjectID = m_lCurrentObjectId + 1, @ObjectID = m_lCurrentObjectId + 1 WHERE m_lObjectId = @ObjectType COMMIT TRANSACTION RETURN @ObjectID
Return the updated value as a return value from SP, type INTEGER.
Now the ADODB portion of the code :
I get an exception : "Mutiple step OLE DB operation generated errors.Code:Set command = New ADODB.command command.ActiveConnection = myConn command.CommandType = adCmdStoredProc command.CommandText = "dbo.proc1" Set param1 = command.CreateParameter("ObjectType", adNumeric, adParamInput, 10) command.Parameters.Append param1 param1.Value = 105 Set param2 = command.CreateParameter("ObjectID", adInteger, adParamReturnValue, 10) command.Parameters.Append param2 command.Execute
I dont understand why !
Can someone help me pls...
Thanks.




Reply With Quote