I am working with classic asp and using stored procedure. I have to get the value of stored procedure out parameter. This is my code
<% @LANGUAGE="VBSCRIPT" CODEPAGE="65001" %>
<!-- METADATA TYPE="TypeLib" NAME="Microsoft ADO Type Library" UUID="{00000205-0000-0010-8000-00AA006D2EA4}" -->
<%
Dim value
Dim i
set con = Server.CreateObject("ADODB.Connection")
con.Open "Provider=SQLOLEDB;Server=aliba\SQLEXPRESS;Database=dummySP;Trusted_Connection=Yes;"
Set Comm = Server.CreateObject("ADODB.Command")
comm.ActiveConnection = con
comm.CommandText = "sp_dummy"
'comm.NamedParameters=true
comm.CommandType = adCmdStoredProc
comm.Parameters.Append comm.CreateParameter("@weight" , adVarchar,adParamInput, 50, "hello")
'comm.Parameters.Append comm.CreateParameter("PRODUCT", adVarchar, adParamInput,50, producttype )
'comm.Parameters.Append comm.CreateParameter("ACCOUNT", adVarchar, adParamInput,100, "" )
comm.Parameters.Append comm.CreateParameter("@pris", adVarchar, adParamOutput,50) 'output parameters
'i=comm.Execute
comm.Execute
value=comm.Parameters("@pris").Value
Response.Write("Value is")
Response.Write(value)
The value of pris is not showing on output.I have no idea what is wrong with this.
I followed this link (Calling SQL Stored Procedure with Output Parameter in VBScript) but does not get success
It is giving me following error
Value is
Response object error 'ASP 0185 : 8002000e'
Missing Default Property
/StoreProcedure.asp, line 0
A default property was not found for the object.
Here is my stored procedure
ALTER procedure [dbo].[sp_dummy]
@weight nvarchar(50),
@pris nvarchar(50)= null out
as
begin
select @pris = pris from sp_dummy_table where weight= @weight
end