How to Create a Decimal-Type Command Parameter in ASP

Hi friends,

Can someone show me the right way to create decimal-type command parameterin ASP?  My code below give me a "precision is invalid" error.


Dim cmdClaimInsertUpdate
Set cmdClaimInsertUpdate = Server.CreateObject("ADODB.Command")
With cmdClaimInsertUpdate
      .ActiveConnection = cn
      .CommandText = "sp_ClaimInsertUpdate"
      .CommandType = adCmdStoredProc
      
      .Parameters.Append = .CreateParameter("@Claim_RepairLaborRate", adDecimal, adParamInput,  , Request.Form("txtClaimRepairLaborRate"))
      
      .Execute
End With
Set cmdClaimInsertUpdate = Nothing



In the sp_ClaimInsertUpdate stored procedure, I have the following declaration...

@Claim_RepairLaborRate      DECIMAL(18,2)      = NULL,

The field name Claim_RepairLaborRate is a decimal type with 18 precision and 2 scale.

Any help on this matter would be so greatly appreciated.

Thanks a bundle,


Jazon from Jacksonville, FL
LVL 3
piratepatrolAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

davidlars99Commented:

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
davidlars99Commented:
piratepatrolAuthor Commented:
Actually, the following line solved my problem.

.Parameters("@Claim_RepairLaborRate").Precision = 18

Thank you for your response.
davidlars99Commented:
yes, but Decimal is 14 not 18
piratepatrolAuthor Commented:
What database are you using?  Mine is 18 by default.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.