tags:

views:

1814

answers:

3

When I call Server.CreateObject(), from my Classic ASP page, I get

Microsoft VBScript runtime (0x800A01B6)
Object doesn't support this property or method

I've tried the following (separately):

Server.CreateObject("Microsoft.XMLHTTP")
Server.CreateObject("MSXML2.XMLHTTP")
Server.CreateObject("MSXML.DOMDocument")

I know the ActiveX objects are installed because the following javascript calls work

var test = new ActiveXObject("Microsoft.XMLHTTP");
var test = new ActiveXObject("MSXML2.XMLHTTP");
var test = new ActiveXObject("MSXML.DOMDocument");

I'm calling it from my localhost IIS server. Any ideas how to troubleshoot this?

+1  A: 

How about this one?

Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")

Or downloading this component and installing on your webserver?

http://www.microsoft.com/downloads/details.aspx?FamilyId=3144B72B-B4F2-46DA-B4B6-C5D7485F2B42&displaylang=en

Then restarting the server and trying again.

Kyle B.
A: 

Calling them from the browser doesn't mean that they are installed in IIS.

craigmoliver
+1  A: 

If you do the following:

Dim x: x = Server.CreateObject("My.ProgID.Here")

...VBScript creates the object and then attempts to access the default property for storing in 'x'. Since none of these objects have a default property defined (specifically an IDispatch-based property with [id(DISPID_VALUE)]), this fails with "Object doesn't support this property or method".

What you actually want is this:

Dim x: Set x = Server.CreateObject("My.ProgID.Here")
Roger Lipscombe
This solution worked! When I wrote similar code run on a different server, I didn't have the same problem. I'm not sure why. Thanks!