Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Classic ASP: Server.CreateObject not supported

Tags:

createobject

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?


2 Answers

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")
like image 155
Roger Lipscombe Avatar answered Nov 28 '25 00:11

Roger Lipscombe


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.

like image 29
Kyle B. Avatar answered Nov 28 '25 01:11

Kyle B.