Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > inetserver iis > june 2005 >

inetserver iis : JScript runtime error 800a138 'undefined' is null or not an object


NO[at]SPAM
6/30/2005 12:10:04 PM
I am running some off-the-shelf software that is written in ASP, which uses
JScript to generate dynamic content within HTML forms. There are several ASP
pages which are partially rendering to IE, but stop midway through with an
error embeded in the page: "Microsoft JScript runtime error '800a138f'
'undefined' is null or not an object".

The software package has a large install base with no other customer having
this problem. I also have a second identical install on another server (same
versions of IIS, .Net, etc..) pointing to the same SQL database, and it
doesn't exibit this problem either.

Our own developers were able to work around the problem by making a small
change to the code.

The original code:

<%=String(rs("Question")).length > 100?
RemoveHTML(String(rs("Section"))).substr(0, 100) + "...":
RemoveHTML(String(rs("Section")))%>

Changed to:

<%if (String(rs("Section")).length > 100)
{Response.Write(String(rs("Section")).substr(0, 100) + "...") ;} else {
Response.Write(rs("Section")); }%>

The latter bit of code had to have two changes.. one to change the odd
conditional statement to a more traditional if-statement, and second to avoid
calling the RemoveHTML function, both which cause an error.

function RemoveHTML(Expresion)
on error resume next
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>"
RegEx.Global = True
Expresion = Replace(Expresion, "<br>", chr(10))
RemoveHTML = RegEx.Replace(Expresion, "")
end function

I've searched Microsoft's KB and Googled the error, and so far nothing
useful has come up. Any ideas on what the cause is or how I can further
troubleshoot?

!!! Again, there is nothing wrong with the code.. it works on hundreds of
other servers. There is something particular about my server that is causing
this !!!

NO[at]SPAM
6/30/2005 12:15:04 PM
I should also note that this is Windows 2000 Advanced Server running IIS 5,
and the application is not written in .Net, but rather old-school ASP.
David Wang [Msft]
6/30/2005 11:17:49 PM
Well, the problem looks to be within RemoveHTML(), which is a custom
function from your off-the-shelf software, so you want to start there.

Unless you can show that the following code snippet fails, the problem will
be either your server's configuration or the custom software:
<%=String(rs("Question")).length > 100?
String(rs("Section")).substr(0, 100) + "...":
String(rs("Section"))%>

Now, I have to note a few weird things you've said:
1. the RemoveHTML() function you showed is written in VBSCRIPT. But the
failure is in JSCRIPT. Totally different languages, so not certain how you
got into that state
2. RegExp.Global requires a certain version of VBScript -- maybe you have an
older copy registered on this machine.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Dan Roberts @ Kent State" <Dan Roberts @ Kent
[quoted text, click to view]
I am running some off-the-shelf software that is written in ASP, which uses
JScript to generate dynamic content within HTML forms. There are several
ASP
pages which are partially rendering to IE, but stop midway through with an
error embeded in the page: "Microsoft JScript runtime error '800a138f'
'undefined' is null or not an object".

The software package has a large install base with no other customer having
this problem. I also have a second identical install on another server
(same
versions of IIS, .Net, etc..) pointing to the same SQL database, and it
doesn't exibit this problem either.

Our own developers were able to work around the problem by making a small
change to the code.

The original code:

<%=String(rs("Question")).length > 100?
RemoveHTML(String(rs("Section"))).substr(0, 100) + "...":
RemoveHTML(String(rs("Section")))%>

Changed to:

<%if (String(rs("Section")).length > 100)
{Response.Write(String(rs("Section")).substr(0, 100) + "...") ;} else {
Response.Write(rs("Section")); }%>

The latter bit of code had to have two changes.. one to change the odd
conditional statement to a more traditional if-statement, and second to
avoid
calling the RemoveHTML function, both which cause an error.

function RemoveHTML(Expresion)
on error resume next
Dim RegEx
Set RegEx = New RegExp
RegEx.Pattern = "<[^>]*>"
RegEx.Global = True
Expresion = Replace(Expresion, "<br>", chr(10))
RemoveHTML = RegEx.Replace(Expresion, "")
end function

I've searched Microsoft's KB and Googled the error, and so far nothing
useful has come up. Any ideas on what the cause is or how I can further
troubleshoot?

!!! Again, there is nothing wrong with the code.. it works on hundreds of
other servers. There is something particular about my server that is
causing
this !!!

Thanks in advance for any help anyone can offer!

NO[at]SPAM
7/1/2005 5:12:01 AM
David,

I haven't been able to explain exactly how that JScript error plays in
either.. the very first line of the .asp file says <%@ Language=JavaScript
%>, and I see a smattering of JavaScript throughout the file, but I don't
have much experience with that.

Our developers had been working on this up to this point.. but at your
prompting, I played around with the code a little myself. When I removed the
RemoveHTML function call from the asp code, but without altering the
formatting of the conditionals, the script worked like it should. So it does
indeed seem to point to the particular function.

So I thought I already verified that I had identical versions of ASP on both
machines.. maybe that's not the case. How would you recommend I go about
verifying all of the necessary components are present and up to date?

Thanks,

--
Dan Roberts, MCSE
Systems Administrator
Administrative Computing Services
Kent State University


[quoted text, click to view]
NO[at]SPAM
7/1/2005 6:11:07 AM
Additional:

I wrote an ASP page which only has that RemoveHTML function in it and a line
of code that calls it.. the function is returning an empty string. There is
no error, but since it is a JScript error, I presume the empty string must be
getting passed to JavaScript, which is getting upset that there is an
'undefined' variable. That fits the error message.

The page works fine on other servers. So it does appear to be non
functioning regex on only my production web server. Where do I go from here?
Both servers are patched to the same level, to the best of my knowledge.

Thanks,

--
Dan Roberts, MCSE
Systems Administrator
Administrative Computing Services
Kent State University
David Wang [Msft]
7/1/2005 8:07:42 PM
I am guessing that the "rs" variable is a RecordSet that is returned from
some ADO call. If so, it suggests that the query is somehow returning
"Question" column with a value whose length > 100, yet not returning a
"Section" column for some reason. You'll want to figure out what is wrong
with the table that is being queried (check the values being returned for
rs("Question") and rs("Section") and see when you are getting invalid values
that make RemoveHTML() choke, and then start looking at why the rs() is
returning those bad values).

<%=String(rs("Question")).length > 100?
RemoveHTML(String(rs("Section"))).substr(0, 100) + "...":
RemoveHTML(String(rs("Section")))%>


--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Dan Roberts @ Kent State" <DanRobertsKentState@discussions.microsoft.com>
[quoted text, click to view]

I wrote an ASP page which only has that RemoveHTML function in it and a line
of code that calls it.. the function is returning an empty string. There is
no error, but since it is a JScript error, I presume the empty string must
be
getting passed to JavaScript, which is getting upset that there is an
'undefined' variable. That fits the error message.

The page works fine on other servers. So it does appear to be non
functioning regex on only my production web server. Where do I go from
here?
Both servers are patched to the same level, to the best of my knowledge.

Thanks,

--
Dan Roberts, MCSE
Systems Administrator
Administrative Computing Services
Kent State University

NO[at]SPAM
7/5/2005 8:10:01 PM
The database call is returning the expected value.. the problem, it turns
out, is that the RemoveHTML function is returning nothing. A perfectly valid
value goes in, and a null comes out.

I tested a snippet of regex code from the RemoveHTML function on both of our
supposedly identical servers. On one server, the code worked as expected..
on the other (where we're having problems), I'm getting null return from the
function.

The question then is: what could cause Regex to not work on a server that is
running the same software, and has been maintained to the save patch level as
the other? I checked the file date and size of asp.dll on both servers, and
I'm afraid they're identical. :-(

--
Dan Roberts, MCSE
Systems Administrator
Administrative Computing Services
Kent State University


[quoted text, click to view]
David Wang [Msft]
7/6/2005 5:02:22 AM
Well, you will have to chase through all code that RemoveHTML ends up
calling and see why the bad value is getting returned on this one server.

It is not likely to be related to anything in IIS nor ASP.DLL because you
are talking about script code -- and IIS/ASP do not run script code. The
Script Runtime executes script code. I would start looking at
JScript.dll/VBScript.dll versions as well as versions of any custom
components called by RemoveHTML.

Patch level does not affect the Script Runtime. Script Runtime is
independent of the OS version. So, it is possible to go to Windows Update
and sync everything up, yet Script Runtime DLLs are different between two
machines running the same OS.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Dan Roberts @ Kent State" <DanRobertsKentState@discussions.microsoft.com>
[quoted text, click to view]
out, is that the RemoveHTML function is returning nothing. A perfectly
valid
value goes in, and a null comes out.

I tested a snippet of regex code from the RemoveHTML function on both of our
supposedly identical servers. On one server, the code worked as expected..
on the other (where we're having problems), I'm getting null return from the
function.

The question then is: what could cause Regex to not work on a server that is
running the same software, and has been maintained to the save patch level
as
the other? I checked the file date and size of asp.dll on both servers, and
I'm afraid they're identical. :-(

--
Dan Roberts, MCSE
Systems Administrator
Administrative Computing Services
Kent State University


[quoted text, click to view]

nick tomkin
4/5/2006 8:58:00 AM
I've had this problem. The problem is that JSCRIPT is screwed. Make sure you
add .Value to your column. IE: RS("PageTitle").Value. Doing this seems to
fix the problem for me.

AddThis Social Bookmark Button