B
Bruce Duncan
I have a form in an ASP page that the user enters a price
for. When I send the parameter to my SQL stored Proc and
refresh the data, it gets rounded up to the nearest
integer. I can change the data just fine in SQL but not
by using my asp page. Can anyone point me in the correct
direction? Below is my code. TIA
lNewPrice = Request.Form("txtprice")
if isempty(lNewPrice) then
lNewPrice = ""
end if
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open Session("strConn")
Set oCmd = Server.CreateObject("ADODB.Command")
set oCmd.ActiveConnection = oConn
oCmd.CommandText = "spEditSupply"
oCmd.commandtype = AdCmdStoredProc
set RetailParam = oCmd.CreateParameter("@NewRetail",
adDecimal, adParamInput)
RetailParam.Precision = 10
RetailParam.NumericScale = 2
oCmd.Parameters.Append RetailParam
oCmd.Parameters("@NewRetail") = lNewPrice
oCmd.Execute
** The script executes without errors. But when I
refresh the data the entered value of 44.95 is saved as
45.
-Bruce
for. When I send the parameter to my SQL stored Proc and
refresh the data, it gets rounded up to the nearest
integer. I can change the data just fine in SQL but not
by using my asp page. Can anyone point me in the correct
direction? Below is my code. TIA
lNewPrice = Request.Form("txtprice")
if isempty(lNewPrice) then
lNewPrice = ""
end if
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open Session("strConn")
Set oCmd = Server.CreateObject("ADODB.Command")
set oCmd.ActiveConnection = oConn
oCmd.CommandText = "spEditSupply"
oCmd.commandtype = AdCmdStoredProc
set RetailParam = oCmd.CreateParameter("@NewRetail",
adDecimal, adParamInput)
RetailParam.Precision = 10
RetailParam.NumericScale = 2
oCmd.Parameters.Append RetailParam
oCmd.Parameters("@NewRetail") = lNewPrice
oCmd.Execute
** The script executes without errors. But when I
refresh the data the entered value of 44.95 is saved as
45.
-Bruce