Friday, September 23, 2005

The 'Escape()' error

It took me quite a while to find out what was going with this error. With the help of Arturo, we cracked it down. Thanks Arturo!

In our boxes, we were experiencing problems with Microsoft Visual Basic Script: could not find a variable called 'Escape()'. In fact, Escape is not a variable but a Vbscript function introduced as part of VBScript version 5.0 .

The main reason it was not working was because we had registered an old version of the vbscript engine in our machines by mistake.

The normal location for the dll is: \System32\vbscript.dll .

One way to check whether you have got the right version is look into the registry for this UUIDs and check for their Inproc32 subkey:

ClassIDs:
---------
{3F4DACA4-160D-11D2-A8E9-00104B365C9F} - VBScript Regular Expression{B54F3741-5B07-11cf-A4B0-00AA004A55E8} - VB Script Language{B54F3742-5B07-11cf-A4B0-00AA004A55E8} - VB Script Language Authoring{B54F3743-5B07-11cf-A4B0-00AA004A55E8} - VBScript Language Encoding

LibIds:
-------
{3EEF9758-35FC-11D1-8CE4-00C04FC2B185} - Microsoft VBScript Global{3F4DACA7-160D-11D2-A8E9-00104B365C9F} - Microsoft VBScript Regular Expressions

To fix it, we just needed to register the right version of the vbscript engine dll, i.e. usually the one in System32 folder.
In a command line window, go to the \System32 folder and type in the following comamnd:
>regsvr32 vbscript.dll

No comments: