Re: What parameter datatype do I use for SQL Server DECIMAL?
- From: "Bob Barrows [MVP]" <reb01501@xxxxxxxxxxxxxxx>
- Date: Thu, 27 Dec 2007 11:17:16 -0500
MSUTech wrote:
Hello All,CmdOb.CreateParameter("SESSION_NumOfCredits",131,1,,Request("NumOfCredit
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
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.
.
- Follow-Ups:
- Prev by Date: Re: How to access varbinary field
- Next by Date: Re: What parameter datatype do I use for SQL Server DECIMAL?
- Previous by thread: How to access varbinary field
- Next by thread: Re: What parameter datatype do I use for SQL Server DECIMAL?
- Index(es):
Relevant Pages
|
|