Please tell me what am I doing wrong here is my SP:
<%@ LANGUAGE=vbscript enablesessionstate=false LCID=1033 %>
<!--#include file="../Connections/newdi
amonds.asp
" -->
<%
Dim Command1__pf_id
Command1__pf_id = ""
if(Request("pf_id") <> "") then Command1__pf_id = Request("pf_id")
Dim Command1__item_id
Command1__item_id = ""
if(Request("item_id") <> "") then Command1__item_id = Request("item_id")
Dim Command1__name
Command1__name = ""
if(Request("name") <> "") then Command1__name = Request("name")
Dim Command1__description
Command1__description = ""
if(Request("description") <> "") then Command1__description = Request("description")
Dim Command1__list_price
Command1__list_price = ""
if(Request("list_price") <> "") then Command1__list_price = Request("list_price")
Dim Command1__image_file
Command1__image_file = ""
if(Request("image_file") <> "") then Command1__image_file = Request("image_file")
Dim Command1__cost_price
Command1__cost_price = ""
if(Request("cost_price") <> "") then Command1__cost_price = Request("cost_price")
Dim Command1__sale_price
Command1__sale_price = ""
if(Request("sale_price") <> "") then Command1__sale_price = Request("sale_price")
Dim Command1__sale_start
Command1__sale_start = ""
if(Request("sale_start") <> "") then Command1__sale_start = Request("sale_start")
Dim Command1__sale_end
Command1__sale_end = ""
if(Request("sale_end") <> "") then Command1__sale_end = Request("sale_end")
Dim Command1__status
Command1__status = ""
if(Request("status") <> "") then Command1__status = Request("status")
%>
<%
set Command1 = Server.CreateObject("ADODB
.Command")
Command1.ActiveConnection = MM_newdiamonds_STRING
Command1.CommandText = "dbo.DiamondsByProduct"
Command1.Parameters.Append
Command1.CreateParameter("
@RETURN_VA
LUE", 3, 4)
Command1.Parameters.Append
Command1.CreateParameter("
@pf_id", 200, 1,100,Command1__pf_id)
Command1.Parameters.Append
Command1.CreateParameter("
@item_id",
129, 1,2,Command1__item_id)
Command1.Parameters.Append
Command1.CreateParameter("
@name", 200, 1,255,Command1__name)
Command1.Parameters.Append
Command1.CreateParameter("
@descripti
on", 200, 1,255,Command1__descriptio
n)
Command1.Parameters.Append
Command1.CreateParameter("
@list_pric
e", 3, 1,4,Command1__list_price)
Command1.Parameters.Append
Command1.CreateParameter("
@image_fil
e", 200, 1,255,Command1__image_file
)
Command1.Parameters.Append
Command1.CreateParameter("
@cost_pric
e", 3, 1,4,Command1__cost_price)
Command1.Parameters.Append
Command1.CreateParameter("
@sale_pric
e", 3, 1,4,Command1__sale_price)
Command1.Parameters.Append
Command1.CreateParameter("
@sale_star
t", 135, 1,8,Command1__sale_start)
Command1.Parameters.Append
Command1.CreateParameter("
@sale_end"
, 135, 1,8,Command1__sale_end)
Command1.Parameters.Append
Command1.CreateParameter("
@status", 3, 1,4,Command1__status)
' Command1.CommandType = 4
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Execute()
%>
<%
set Command1 = Server.CreateObject("ADODB
.Command")
Command1.ActiveConnection = MM_newdiamonds_STRING
Command1.CommandText = "dbo.DiamondByDepartment"
Command1.CommandType = 4
Command1.CommandTimeout = 0
Command1.Prepared = true
Command1.Parameters.Append
Command1.CreateParameter("
@RETURN_VA
LUE", 3, 4)
Command1.Parameters.Append
Command1.CreateParameter("
@pf_id", 200, 1,100,Command1__pf_id)
Command1.Parameters.Append
Command1.CreateParameter("
@dept_id",
3, 1,4,Command1__dept_id)
Dim Command1__dept_id
if Request("dept_id").Count <> 0 then
for index = 1 to Request("dept_id").Count
Command1.Parameters("@dept
_id").Valu
e = Request("dept_id")(index)
Command1.Execute()
next
end if
%>
and here is the error message:
Microsoft OLE DB Provider for ODBC Drivers error '80040e14'
[Microsoft][ODBC SQL Server Driver][SQL Server]Procedure 'DiamondsByProduct' expects parameter '@pf_id', which was not supplied.
/manager/insertsp.asp, line 69
line 69 is reffering to the
Command1.Execute()
and I can print pf_id if I do the response.write thing.
Thanks