We recently purchased new hardware at work (2x IBM eServers) for the pending rollout of our new software. The new software went live on Monday and as a by product of the change, some of our existing sites in ASP3 also had to be moved around.
Before the move, all the sites were functioning error free on a Windows 2000 Server platform with IIS5. Once moved onto the new servers, which were Windows 2003 Server and IIS6 – some of them started throwing errors in various places. These sites were initially written between 12 and 18 months ago now; so the code was capable of working fine if the initial programmer had taken some care.
The error I received was:
Microsoft VBScript runtime error '800a000d'
Type mismatch
/default.asp, line 518
Line #518 had this to reveal:
If Session("GreatDealID")=52 Then
So the error is clear, Session("GreatDealID")
was being stored as a string in the Session. It was compared to a numeric type and failed. The solution would be either of the following lines:
If Session("GreatDealID")="52" Then
If CInt(Session("GreatDealID"))=52 Then
What I find interesting, is that in IIS5, it was more than happy to automatically cast the Session("GreatDealID")
from a VBString into a VBInteger, yet IIS6 threw an error. I initially thought it might have had something to do with IIS6 enforcing an Option Explicit
for ASP. However if it did that, all of the undefined variables used through the site (I know) would have also thrown errors, yet they didn’t.
I haven’t bothered looking to find out exactly why the error suddenly appeared. For the moment, “the code was poor, it then errored”, will do. Anyone else come across it or know why it changed in IIS6, if that is infact the cause?
Alistair,
Did you ever figure out why this was happening? We just experienced the same thing and would hate to have to modify loads of code.
Thanks!
Dave
now ı am coming across proplem such as Request object error ‘ASP 0104 : 80004005’
Operation not Allowed
/ResimEkle.asp, line 80 .
ı would like to help me at this subject. in advence thank you for your help.
best regards