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"