473,804 Members | 3,030 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IsNumeric returns false inexplicably

For some reason all of a sudden number values pulled from a SQL server field
with a datatype of "numeric" are not being recognized by asp classic as valid
number values. They were previously, but now are not. When I use the
"IsNumeric" function, it returns false. When I try to Ctype it to an integer,
I get an "overflow" error. If I change the datatype of the database field to
"int", it works fine. Whats the deal? The values I'm working with currently
range from 33800 to 33850.
Jul 22 '05 #1
2 2016
CInt in VBScript only goes to 32k. So, use CLng instead.

IsNumeric isn't exactly the most accurate test, either, but in order to see
what is going on, please provide a repro.

--
http://www.aspfaq.com/
(Reverse address to reply.)


"Glenn Venzke" <Gl*********@di scussions.micro soft.com> wrote in message
news:1A******** *************** ***********@mic rosoft.com...
For some reason all of a sudden number values pulled from a SQL server field with a datatype of "numeric" are not being recognized by asp classic as valid number values. They were previously, but now are not. When I use the
"IsNumeric" function, it returns false. When I try to Ctype it to an integer, I get an "overflow" error. If I change the datatype of the database field to "int", it works fine. Whats the deal? The values I'm working with currently range from 33800 to 33850.

Jul 22 '05 #2
Glenn Venzke wrote:
For some reason all of a sudden number values pulled from a SQL
server field with a datatype of "numeric"
"numeric" is not a sufficient description of the column's datatype. Please
tell us the precision and scale of the column.
are not being recognized by
asp classic as valid number values. They were previously, but now are
not.
So what changed? And please provide some context. Are you talking about
recordset fields? If so, what does the Type property of the field contain?
Or are you talking about stored procedure output parameters?
When I use the "IsNumeric" function, it returns false. When I
try to Ctype it to an integer, I get an "overflow" error.
I don't know of a Ctype function. Please be specific.
If I change
the datatype of the database field to "int", it works fine. Whats the
deal? The values I'm working with currently range from 33800 to 33850.


That's why I asked you to be specific. CInt would generate an overflow error
with these values. CLng would not.

Bob Barrows
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Jul 22 '05 #3

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

Similar topics

5
1518
by: Steven Burn | last post by:
Anyone have any why the following, returns true? '// Leave everything after the ? strTemp = StripQStr("/?DD0898SDFSDFSD89Q2ASD8822") If IsNumeric(StrTemp) Then Response.Write strTemp & " is numeric" else Response.Write strTemp & " is not numeric" end if
8
2325
by: eje | last post by:
IsNumeric(value) should return false if value "can not be successfully converted to a Double." Instead I get the following error message: "Input string was not in a correct format." I use the following function in a validating class to use when needed. (Value = H880118A gave the error (like other 'unconvertible' strings)) Public Function Numeric(ByVal value) As Boolean
3
5209
by: Joel | last post by:
In VBA, you can use IsNumeric to return True or False if the value being tested is numeric. Is there an equivalent to this in VB.NET?
8
2614
by: John Bowman | last post by:
Hello, Does anyone have a good/reliable approach to implementing an IsNumeric() method that accepts a string that may represent a numerical value (eg. such as some text retrieved from an XML file)? Thus if you pass it "1" or "5.12345" it returns true, but "1b3q" it returns false? I know VB has this sort of function, but was wondering how to implement something similar in C#. I suppose I could use the Convert methods and catch any...
10
2802
by: michele | last post by:
I have a problem with VB.Net and IsNumeric() function because it always returns FALSE even the string can be a number. There is another strange thing, the same program (it is a test) runs good on one and doesn't run an another one. The program test is very simple, just a form with a text box and a button. The text box has a validation rule that check if the insert string is a numeric value, that's all.
7
2386
by: Nathan Truhan | last post by:
All, I think I may have uncovered a bug in the IsNumeric function, or at least a misunderstanding on functionality. I am writing a Schedule Of Classes Application for our campus and have a section that lists the Times, Buildings and rooms for courses. In this section I have a function called PadCell that takes3 parameters, one the value, one a padd count and one a a boolean input called StripNumeric, that if true, checks if the value...
9
2316
by: =?Utf-8?B?VG9ueQ==?= | last post by:
Can anybody tell why IsNumeric("5-") is true?
4
3734
by: =?Utf-8?B?QW5kcmV3?= | last post by:
Hello, friends, In VB6, we have function IsNumeric(). What is the correpsonding function in c#.net? Thanks.
17
2302
by: MLH | last post by:
I have tested the following in immed window: ?isnumeric(1) True ?isnumeric(1.) True ?isnumeric(1.2) True ?isnumeric(1.2.2)
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10326
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4295
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.