SP Command Error
am 22.01.2007 17:16:38 von ManglerI a running a SP and calling it through ASP. I keep getting this
error:
Parameter object is improperly defined. Inconsistent or incomplete
information was provided.
I think I have the format of the date wrong somewhere. Can someone
help?
Here is the command:
<%
Dim spDup__rma
spDup__rma = ""
if(Request.Form("hdnrma") <> "") then spDup__rma =
Request.Form("hdnrma")
Dim spDup__model
spDup__model = ""
if(Request.Form("hdnmodel") <> "") then spDup__model =
Request.Form("hdnmodel")
Dim spDup__part
spDup__part = ""
if(Request.Form("part") <> "") then spDup__part = Request.Form("part")
Dim spDup__qty
spDup__qty = ""
if(Request.Form("hdnqty") <> "") then spDup__qty = Request.Form("qty")
Dim spDup__date
spDup__date = ""
if(Request.Form("btdate") <> "") then spDup__date =
Request.Form("btdate")
%>
<%
set spDup = Server.CreateObject("ADODB.Command")
spDup.ActiveConnection = MM_connReclaim_STRING
spDup.CommandText = "dbo.dup"
spDup.Parameters.Append spDup.CreateParameter("@RETURN_VALUE", 3, 4)
spDup.Parameters.Append spDup.CreateParameter("@rma", 200,
1,15,spDup__rma)
spDup.Parameters.Append spDup.CreateParameter("@model", 200,
1,15,spDup__model)
spDup.Parameters.Append spDup.CreateParameter("@part", 200,
1,5,spDup__part)
spDup.Parameters.Append spDup.CreateParameter("@qty", 200,
1,15,spDup__qty)
spDup.Parameters.Append spDup.CreateParameter("@date", 135,
1,30,spDup__date)
spDup.Parameters.Append spDup.CreateParameter("@result", 200, 2)
spDup.CommandType = 4
spDup.CommandTimeout = 0
spDup.Prepared = true
spDup.Execute()
spDupResult = spDup("@result")
%>
The format of the date going to the SP is ......
FormatDateTime(Now,2) .......
The format of the date in the SP is ................ smalldatetime
...........................
Everything inserts to the DB fine with the above 2 formats together but
it seems to be thowing the SP command off.