Server.CreateObject() vs new ActiveXObject()

A

Andrew Hilton

When you create an object in classic asp code, should you always use
Server.CreateObject("ProgID")? Are there implications with stability (ie
memory leaks) if you create COM objects in other ways in IIS?

We use Javascript for our ASP coding, using a mixture of
Server.CreateObject() and new ActiveXObject(). The web server hangs
occasionally (once every 2-3 months) and we were wondering if this might be
the culprit...

Thanks!
Andrew
 
E

Egbert Nierop \(MVP for IIS\)

Andrew Hilton said:
When you create an object in classic asp code, should you always use
Server.CreateObject("ProgID")? Are there implications with stability (ie
memory leaks) if you create COM objects in other ways in IIS?

Server.CreateObject is NT Option Pack 4 (NT4) legacy code and includes some
overhead.
We use Javascript for our ASP coding, using a mixture of
Server.CreateObject() and new ActiveXObject(). The web server hangs
occasionally (once every 2-3 months) and we were wondering if this might
be the culprit...

No definitely not. You could install debugdiag to know what was the real
cause.

http://www.microsoft.com/windowsserver2003/iis/diagnostictools/default.mspx
 
T

Tom Kaminski [MVP]

Andrew Hilton said:
When you create an object in classic asp code, should you always use
Server.CreateObject("ProgID")? Are there implications with stability (ie
memory leaks) if you create COM objects in other ways in IIS?

We use Javascript for our ASP coding, using a mixture of
Server.CreateObject() and new ActiveXObject(). The web server hangs
occasionally (once every 2-3 months) and we were wondering if this might
be the culprit...

http://www.aspfaq.com/show.asp?id=2336
 
A

Andrew Hilton

Egbert,

Egbert Nierop (MVP for IIS) said:
Server.CreateObject is NT Option Pack 4 (NT4) legacy code and includes
some overhead.

Is it really legacy code? I can't find anything on MSDN to support that.
However I now know it's primarily used to launch COM+ objects, which makes
me wonder if the object is loaded into another process. In any case, it's
good enough argument to start using 'new ActiveXObject()'.
No definitely not. You could install debugdiag to know what was the real
cause.

http://www.microsoft.com/windowsserver2003/iis/diagnostictools/default.mspx
Thank you, I will give this a try.

Andrew
 
E

Egbert Nierop \(MVP for IIS\)

Andrew Hilton said:
Egbert,



Is it really legacy code? I can't find anything on MSDN to support that.
However I now know it's primarily used to launch COM+ objects, which makes

Yes, it is really legacy code. I don't want to proof this point by digging
into old MSDNs, just try this on NT4 with the option pack.
me wonder if the object is loaded into another process. In any case, it's
good enough argument to start using 'new ActiveXObject()'.

sure it is good enough. for instance, ADODB does nothing, really nothing
with ASP while IIS tries to find some legacy method 'OnStartPage' through
late binding if you use Server.CreateObject and it also did some things with
transactions in the past I believe.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,007
Latest member
obedient dusk

Latest Threads

Top