Hello Friends !
I have the Following Code, that Executes a Stored Procedure and Attempt to
read a Returned Integer Value from the StoredProc.
But It gives Error ...
ADODB.Command (0x800A0BB9)
Arguments are of the wrong type, are out of acceptable range, or are in
conflict with one another.
/C4U/DBOutputParameterTest.asp, line 25
Can some one Points Out the Problem ....
REM=============================================== ======================
<BODY>
<%
Const adCmdStoredProc = 4
Dim objConnection, objCommand, objParameter, sSQL
Set objConnection = Server.CreateObject("AdoDB.Connection")
Set objCommand = Server.CreateObject("AdoDB.Command")
Set objParameter = Server.CreateObject("AdoDB.Parameter")
'Dim objParameter 'As AdoDB.Parameter
sSQL = "Execute RegisterMessage '13', 'Accounting', 'Accounts', '24304',
'Hello By Test Message', 'P', '2492331', 'VipulP: The Tester'"
objConnection.Open Session("CONNECTION_STRING")
Set objCommand.ActiveConnection = objConnection
objCommand.CommandText = sSQL
objCommand.CommandType = adCmdStoredProc
Set objParameter = objCommand.CreateParameter("Return", adInteger,
adParamReturnValue,,0)
objCommand.Parameters.Append objParameter
Response.Write "SQL: " & sSQL & "<BR>"
'Response.End()
objCommand.Execute()
IF objConnection.Errors.Count > 0 Then
Response.Write "ERROR:<P>"
Response.Write "Error # " & objConnection.Errors(0).Number & "<BR>"
Response.Write "Error Description: " &
objConnection.Errors(0).Description & "<BR>"
Response.Write "Error Source: " & objConnection.Errors(0).Source & "<BR>"
Else
Response.Write "Generated Message Id: " &
objCommand.Parameters.Item("MsgId").Value & "<P>"
End IF
objCommand.Parameters.Refresh()
For Each objParameter In objCommand.Parameters
Response.Write objParameter.Name & ": " & objParameter.Value & "<BR>"
Next
%>
</BODY>
REM=============================================== ======================
Thanks !
------------------------------
V I P U L P A T H A K
eBot Technosoft Limited,
Indore, (MP), India.
http://www.ebotsoft.com