Re: What parameter datatype do I use for SQL Server DECIMAL?



MSUTech wrote:
Hello All,

I have a decimal(15,2) value in a SQL Server stored procedure. I am
trying to use 'adNumeric (131)' as my parameter within my asp page,
but, I am getting

"Multiple-step OLE DB operation generated errors. Check each OLE DB
status value, if available. No work was done."

What should I be using?


CURRENT:
CmdOb.Parameters.Append

CmdOb.CreateParameter("SESSION_NumOfCredits",131,1,,Request("NumOfCredit
s"
& TheCount))

The problem is not the datatype: it is the failure to set the
NumericScale and Precision properties of the Parameter object before
assigning a value to it. With decimal/numeric parameters, you need to
add the extra two steps before setting the parameter value:

Set Parm = CmdOb.CreateParameter("SESSION_NumOfCredits",131)
Parm.Precision = 15
Parm.NumericScale = 2
Parm.Value = Request("NumOfCredits" & TheCount)
CmdOb.Parameters.Append Parm

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.


.



Relevant Pages

  • Re: What parameter datatype do I use for SQL Server DECIMAL?
    ... I have a decimalvalue in a SQL Server stored procedure. ... trying to use 'adNumeric ' as my parameter within my asp page, ... "Multiple-step OLE DB operation generated errors. ... Please reply to the newsgroup. ...
    (microsoft.public.data.ado)
  • RE: asp pages error
    ... our intranet connects to several access databases we dont get an asp ... I tried to add a new site to iis, ... > down and type the full content of the error message to the Newsgroup. ... > SP1 on your SBS 2K3 server? ...
    (microsoft.public.windows.server.sbs)
  • Re: ASP Error HTTP-500 "The Requested Resource is in Use" SBS2003
    ... Microsoft CSS Online Newsgroup Support ... I can not browse asp pages. ... >> whether there are any error messages about this issue, ... >> Microsoft CSS Online Newsgroup Support ...
    (microsoft.public.windows.server.sbs)
  • Re: Microsoft VBScript runtime error 800a01c9
    ... this is the wrong newsgroup for this. ... I would post your question to the appropriate (ASP) ... > Function InitQueryMap() ... > If I delete the global.asa file then basic asp pages work. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Session Timer
    ... dim strSQL, timein, timeout, timespent, user ... > Nothing that can be done via ASP server-side code. ... > client-side code but even that will not be ... Post your question to a client-side newsgroup, ...
    (microsoft.public.inetserver.asp.db)