By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,570 Members | 1,251 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,570 IT Pros & Developers. It's quick & easy.

IsNumeric returns false inexplicably

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
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*********@discussions.microsoft.com> wrote in message
news:1A**********************************@microsof t.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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.