Forum Moderators: open

Message Too Old, No Replies

VBScript error type mismatch on new 2003 server

         

soundclash

5:05 pm on Feb 28, 2008 (gmt 0)

10+ Year Member



Hello, I got this vbs error.

Microsoft VBScript runtime error '800a000d'
Type mismatch: 'CDbl'


...
dCalcMinX = CDbl(Request.Form("X1"))
...

We just switch from Windows 2000 server to Windows 2003.
The code is quite old but was working fine on the 2000 server.

Can it be some settings or vbscript functions?

bmcgee

2:13 am on Feb 29, 2008 (gmt 0)

10+ Year Member



I believe CDbl() will throw an error if the contents of the parameter are not numeric.

Check your form field, it's probably blank.

digitalv

2:29 am on Feb 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There might be an extra space at the end that needs to be trimmed off, or the value just isn't a number.

Always trim off extra spaces and use this in front of it:

If isNumeric(Trim(request.form("x1"))) Then
dcalcminx = cdbl(trim(request.form("x1")))
Else
' your error handler
End If

soundclash

2:52 pm on Mar 3, 2008 (gmt 0)

10+ Year Member



I ran to this phrase on some site and happen to be right for me.
«Vbscript should behave like Session.LCID is configured»

Some how my server is not configured like it should.
Some decimal value had "," and some others had "." for delimeter.
That cause the mismatch.

I add this in my global.asa and work well.

session.lcid = 4105

Thank you for your comments