473,322 Members | 1,806 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

The precision is invalid

Hello all - I could use a little CreateParameter help - I am trying to pass
parameter to a stored procedure on a SQL Server 2000 DB and one of the
columns I think I am having a problem with is a float data type.
Right now my append statement looks like this:
cmdpay.Parameters.Append (cmdpay.CreateParameter("@Amount", adDecimal,
adParamInput,15, Request.Form("txtPaymentAmount"))).
When I execute the stored proc, it returns a precision is invalid error, but
I cannot find a adFloat parameter sample anywhere - am I missing something
here? Any help would be greatly appreciated. I asked our DBA to make the
data type for the column a decimal, but NOOOOO he wants it to be a float
instead.

thanks.
Jul 19 '05 #1
2 10075
Scott wrote:
Hello all - I could use a little CreateParameter help - I am trying
to pass parameter to a stored procedure on a SQL Server 2000 DB and
one of the columns I think I am having a problem with is a float data
type.
Right now my append statement looks like this:
cmdpay.Parameters.Append (cmdpay.CreateParameter("@Amount", adDecimal,
adParamInput,15, Request.Form("txtPaymentAmount"))).
When I execute the stored proc, it returns a precision is invalid
error, but I cannot find a adFloat parameter sample anywhere - am I
missing something here? Any help would be greatly appreciated. I
asked our DBA to make the data type for the column a decimal, but
NOOOOO he wants it to be a float instead.

thanks.


You have to set the Precision and NumericScale properties after the
Parameter object is created.

You would probably benefit from my free stored procedure code generator
which is available here:

http://www.thrasherwebdesign.com/ind...s&hp=links.asp

HTH,
Bob Barrows

--
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.
Jul 19 '05 #2
Hi Scott,

In method CreateParameter, if you specify a numeric data type (adNumeric or
adDecimal) in the Type argument, then you must also set the NumericScale
and Precision properties.For example:

dim p1

set p1=cmdpay.CreateParameter("@Amount", adDecimal, adParamInput,15,
Request.Form("txtPaymentAmount"))

p1.NumericScale=5

p1.Precision=10

cmdpay.Parameters.Append p1

Hope this help,

Luke
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: shank | last post by:
Using Dreamweaver, I'm trying to update a table using a stored procedure. I'm getting the following error. The line# reference is on the last line: rsUpdate.Execute(). That doesn't help much, but...
4
by: Roger Leigh | last post by:
Hello, I'm writing a fixed-precision floating point class, based on the ideas in the example fixed_pt class in the "Practical C++ Programming" book by Steve Oualline (O' Reilly). This uses a...
2
by: Brian van den Broek | last post by:
Hi all, I guess it is more of a maths question than a programming one, but it involves use of the decimal module, so here goes: As a self-directed learning exercise I've been working on a...
1
by: Edwin E. Smith | last post by:
I'm just learning C# so for practice, I decided to try and duplicate some of the functionality of the Microsoft Calculator from scratch. I used double precision (64 bit) types I.E. private...
1
by: Reza Nabi | last post by:
Dear All: I have been developing ASP.NET application on MS Access database using ODBC. When I was trying to save more than 255 chars in a Memo field I got the following error. ERROR Invalid...
0
by: jwtulp | last post by:
Hello all, I receive the following error when updating MSAccess2003 Memo fields using an ODBC connection in ASP.Net 1.1 when the length of the text to be updated exceeds 255 characters....
15
by: giff | last post by:
Hi all, I have a doubt, I'll try to expose it to you as clearly as I can, maybe it is not completely in topic, sorry about that. I have a few vectors of doubles (output of some calculations)...
4
by: marathoner | last post by:
After reading the string representation of a double precision number, -0.417597000000000D+06, from a text file, I am unable to convert it to a double precision number. Here is the code I am using:...
3
by: =?Utf-8?B?R1ROMTcwNzc3?= | last post by:
help, I'm trying to access a stored procedure The stored procedure works fine when run from the server) the code is below - CREATE PROCEDURE updatepricing @siteid INT, @siteid2 INT, @siteid3...
4
by: apellerin | last post by:
I am having an issue where I need to multiply a double value by a value with four decimal places within a calc field. However, it will only allow me to multiply by a whole number. "Invalid...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.