Link to home
Start Free TrialLog in
Avatar of bsandeman
bsandeman

asked on

ASP Object Creation

Hi,
I receive the following error:
---------------------------------
Server object error 'ASP 0177 : 80004001'

Server.CreateObject Failed

/bruce/wp/js.asp, line 13

Not implemented
---------------------------------

This occurs for the following code written in Javascript:
---------------------------------------
<%@ LANGUAGE="JavaScript" %>
<HTML>
<HEAD>
<TITLE>WP Javascript Test</TITLE>
</HEAD>
<BODY>

<%
test();

function test()
{
var wp = Server.CreateObject("WordPerfect.PerfectScript");

wp.Quit();
wp = "";
}
%>
<br>
hello
</BODY>
</HTML>
---------------------------------------

However, it seems to work through VBScript:
---------------------------------------
<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>WP VB Test</TITLE>
</HEAD>
<BODY>

<%
test

Private Sub test()
      Dim WP

      Set WP = CreateObject("WordPerfect.PerfectScript")

      WP.Quit    

      Set WP=Nothing    
End Sub
%>
hello
</BODY>
</HTML>
---------------------------------------

cheers
Bruce
Avatar of RBertora
RBertora
Flag of United Kingdom of Great Britain and Northern Ireland image

Your second option is not VB script it is ASP code, you can only create the
server object in ASP. not vb or java script. (see your second example is inbetween
<% and %> this is all asp code.
Rob;-)
ASKER CERTIFIED SOLUTION
Avatar of jkunal
jkunal
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bsandeman
bsandeman

ASKER

RBertora -> Both are ASP one written in VBScript and one written in Javascript.
ASP is not a language as such but a technology.
jkunal -> Thanks a lot for your quick answer.  I did not find that documented anywhere.
cheers
Bruce
plsr

;->
Usually, Server.CreateObject works for JavaScript, too (check with other class strings).

There are always incompatibilites when getting different languages together. VBScript seems to be more tolerant than JavaScript (in MS's implementation).

BTW, in JavaScript, I'ld null;
wp = null