please dont rip this site

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

By default, objects created by the Server.CreateObject method have page scope. This means that they are automatically destroyed by the server when it finishes processing the current ASP page.

To create an object with session or application scope, you can either use the <OBJECT> tag and set the SCOPE parameter to SESSION or APPLICATION, or store the object in a session or application variable.

For example, an object stored in a session variable, as shown in the following script, is destroyed when the Session object is destroyed. That is, when the session times out, or the Abandon method is called.

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

You can also destroy the object by setting the variable to NOTHING or setting the variable to a new value, as shown below. The first example releases the object ad. The second replaces ad with a string.

<% Session("ad") = Nothing %>
<% Session("ad") = "some other value" %>
 

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


© Microsoft Corporation. All rights reserved.


file: /Techref/language/asp/OBJ/introbj_34.htm, 3KB, , updated: 1996/11/21 18:01, local time: 2024/11/26 21:45,
TOP NEW HELP FIND: 
18.221.175.48:LOG IN

 ©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?
Please DO link to this page! Digg it! / MAKE!

<A HREF="http://techref.massmind.org/techref/language/asp/OBJ/introbj_34.htm"> CreateObject</A>

After you find an appropriate page, you are invited to your to this massmind site! (posts will be visible only to you before review) Just type a nice message (short messages are blocked as spam) in the box and press the Post button. (HTML welcomed, but not the <A tag: Instead, use the link box to link to another page. A tutorial is available Members can login to post directly, become page editors, and be credited for their posts.


Link? Put it here: 
if you want a response, please enter your email address: 
Attn spammers: All posts are reviewed before being made visible to anyone other than the poster.
Did you find what you needed?

 

Welcome to massmind.org!

 

Welcome to techref.massmind.org!

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  .