CreateObject

The CreateObject method creates an instance of a server component. If the component has implemented the OnStartPage and OnEndPage methods, the OnStartPage method is called at this time. For more information about server components, see the Component Reference.

Syntax

Server.CreateObject( progID )

Parameters

progID
Specifies the type of object to create. The format for progID is [Vendor.]Component[.Version].

Remarks

You cannot create an object instance with the same name as a built-in object. For example, the following returns an error:

 <% Set Response = Server.CreateObject("Response") %> 
 

Example

 <% Set MyAd = Server.CreateObject("MSWC.AdRotator") %> 
 

The preceding example creates a server component, MyAd, as a MSWC.AdRotator component that can be used to automate rotation of advertisements on a Web page. For more information about server components, see the Component Reference.

Applies To

Server Object