Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Discussion] Server.CreateObject = old styled + slower

4 views
Skip to first unread message

Egbert Nierop (MVP for IIS)

unread,
Jun 19, 2003, 8:48:08 AM6/19/03
to
Hi,

FYI

I see many sample codes using Server.CreateObject("ADODB.Recordset") or
Server.CreateObject("CDO.Message")...
instead of CreateObject("ADODB.RecordSet") or CreateObject("CDO.Message")

Arguments to use the 'Server' object, are invalid since microsoft introduced
IIS 5 where the transaction context is included in COM+ in any component
that wants to enlist a transaction.

Another thing is on IIS5 that 'Server' does not lead to smarter component
component detection or such as sometimes was the case on IIS 4 (agility
detection)

The Server keyword leads to extra code overhead internally like this: IIS
tries to call 'legacy code' like OnStartPage and OnEndPage (that do not work
nicely on Asp.Net b.t.w.).

Last argument: I've made some COM+ components that retrieve the IIS 5 + ASP
references internally (that is using GetObjectContext("Response") ).
IIS 5 will crash when you use the Application object for instance.
Workaround: Don't use Server.CreateObject if your ASP COM+ component needs
the Application context.

Tests showed that leaving out Server also leads to better error descriptions
if an error pops-up.

Cheers

Egbert

Bob Barrows

unread,
Jun 19, 2003, 8:53:47 AM6/19/03
to
Some of us are still using IIS4 ...
All my code samples are geared for that platform, but thanks for the
heads-up - my company should be migrating to IIS 5 sometime this year.

Bob Barrows

0 new messages