473,320 Members | 2,052 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,320 software developers and data experts.

Need help with numeric variables

GJ
Hello,

After moving my website from one server to another (Windows 2000, IIS 5,
same as old server), I am forced to use the cInt function to convert all
variables that compare against a numeric value.

For example, on the old server I could code something like this:
If sRecCount > 0 then . . .

The new server requires me to use:
If cInt(RecCount) > 0 then . . .

If I don't use the cInt function, I get a Type Mismatch error. I can't see
anything that is different from one server to another.

Any ideas?

Thanks.
Jul 22 '05 #1
1 1387
GJ wrote:
Hello,

After moving my website from one server to another (Windows 2000, IIS
5, same as old server), I am forced to use the cInt function to
convert all variables that compare against a numeric value.

For example, on the old server I could code something like this:
If sRecCount > 0 then . . .
Why "s" in sRecCount? I usually use the prefix to denote the datatype of the
data contained in the variale: "s" = string, "i" = integer, etc. This is for
readability and maintainability only: it has no effect on the way the
compiler processes the variables.

The new server requires me to use:
If cInt(RecCount) > 0 then . . .

If I don't use the cInt function, I get a Type Mismatch error. I
can't see anything that is different from one server to another.

I'm not sure why this is happening, but you should think of it as a blessing
in disguise. It is good programming practice to explicitly type your
variables. usually you only need to do it once: when assigning a value to
the variable:

sRecCount = CInt(<some value>)

I understand this may require some large amount of rewriting, which will be
painful, but in the end, it will be worth it.

My guess as to why it's happening: your new server has different regional
settings for the IUSR account, causing it to not recognize commas or decimal
points being used to create the numeric values.
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 #2

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

Similar topics

2
by: entoone | last post by:
I have a field called pword, whenever someone enters anything but numeric, i.e. mixed alpha with numeric, or even just alpha.. the following error appears. Warning: mysql_numrows(): supplied...
5
by: bandw | last post by:
I am having a problem using Numeric-24.0b2 in conjunction with the NetCDF module from ScientificPython (version 2.4.9). This problem does not surface using Numeric-23.8. The problem arises in...
3
by: Mark | last post by:
Hi, Im trying to validate a form, all the validating works apart from one field. This particular field must consist of the first 2 characters as letters, & the following 5 as numbers. And if it...
9
by: Robert Schneider | last post by:
Hi to all, I don't understand that: I try to delete a record via JDBC. But I always get the error SQL7008 with the error code 3. It seems that this has something to do with journaling, since the...
8
by: Lyn | last post by:
I am trying to get my head around the concept of default, special or empty values that appear in Access VBA, depending on data type. The Access Help is not much (help), and the manual that I have...
5
by: Rene | last post by:
I have my object model thing going with some classes that contain properties that are saved into a database. Some of these properties are *numeric* properties that can be left Null in the database...
5
by: Eric BOUXIROT | last post by:
hi all !!! i need to call this API : FTD2XX_API FT_STATUS WINAPI FT_ListDevices(PVOID pArg1,PVOID pArg2,DWORD Flags) i have a sample code in C++ that work fine... > FTD2XX_API FT_STATUS...
1
by: Crazy Cat | last post by:
Hi, whenever the underlying query being called by EXEC in the following has an empty result set I get the following error -- Invalid Data for 'Numeric' when EXEC returns empty row. However if I...
10
by: Tomás | last post by:
When you simply want to store a number, what integral type do you use? For instance, let's say we have the following in a Poker game: struct Card { enum Suit { Hearts, Diamonds, Spades, Clubs...
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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: 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...
0
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
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.