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. 2 10076
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.
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.) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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...
|
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...
|
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...
|
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....
|
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)...
|
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:...
|
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...
|
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...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
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...
|
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)...
|
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...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
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....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
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...
| |