My script for a simple call on a record count displays error message:
(stored procedure)
CREATE PROCEDURE ad_GoldPrFix_ProdSoldByWT_Count
AS
Declare @count Int
Select @count=count(ProductID)
From ASPProducts
Where OneSoldByWt = 1
Return @count
(VBScript after adovbs.inc, connection & Dims)
Set objCmd = Server.CreateObject("ADODB.Command"
Set objParm = Server.CreateObject("ADODB.Parameter"
objCmd.ActiveConnection = Conn
ObjCmd.CommandText = "(? = Call dbo.ad_GoldFix_ProdSoldByWT_Count)"
objCmd.CommandType = adCmdStoredProc
Set objParm = objCmd.CreateParameter("Return",adInteger,adParamReturnValue,5)
objCmd.Parameters.Append(objParm)
objCmd.Execute 'line 38 see error msg
Response.Write "There are " & objCmd.Parameters.Item("Return".Value & _
" records in ASPProducts.OneSoldByWt"
Set objCmd = Nothing
Set objParm = Nothing
(error msg)
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
No value given for one or more required parameters.
/aaaUD.asp, line 38
tried a different way of adding parameters with no joy
i.e.
ObjCmd.Prepared = False
Set objParm1 = Server.CreateObject("ADODB.Parameter"
objParm1.Name = "return"
objParm1.Type = adInteger
objParm1.Direction = adParamReturnValue
objParm1.Precision = 5
objParm1.NumericScale = 0
objCmd.Parameters.Append(objParm)
I'm missing something - any help appreciated
mty
(stored procedure)
CREATE PROCEDURE ad_GoldPrFix_ProdSoldByWT_Count
AS
Declare @count Int
Select @count=count(ProductID)
From ASPProducts
Where OneSoldByWt = 1
Return @count
(VBScript after adovbs.inc, connection & Dims)
Set objCmd = Server.CreateObject("ADODB.Command"
Set objParm = Server.CreateObject("ADODB.Parameter"
objCmd.ActiveConnection = Conn
ObjCmd.CommandText = "(? = Call dbo.ad_GoldFix_ProdSoldByWT_Count)"
objCmd.CommandType = adCmdStoredProc
Set objParm = objCmd.CreateParameter("Return",adInteger,adParamReturnValue,5)
objCmd.Parameters.Append(objParm)
objCmd.Execute 'line 38 see error msg
Response.Write "There are " & objCmd.Parameters.Item("Return".Value & _
" records in ASPProducts.OneSoldByWt"
Set objCmd = Nothing
Set objParm = Nothing
(error msg)
Microsoft OLE DB Provider for ODBC Drivers error '80040e10'
No value given for one or more required parameters.
/aaaUD.asp, line 38
tried a different way of adding parameters with no joy
i.e.
ObjCmd.Prepared = False
Set objParm1 = Server.CreateObject("ADODB.Parameter"
objParm1.Name = "return"
objParm1.Type = adInteger
objParm1.Direction = adParamReturnValue
objParm1.Precision = 5
objParm1.NumericScale = 0
objCmd.Parameters.Append(objParm)
I'm missing something - any help appreciated
mty