w3schools    w3Schools
Search :
   
HOME HTML CSS XML JAVASCRIPT ASP PHP SQL MORE...   References Examples Forum About
ADVERTISEMENTS

XML Certification
Download XML editor
Custom Programming
 
Table of contents
ASP Tutorial
ASP HOME
ASP Introduction
ASP Install
ASP Syntax
ASP Variables
ASP Procedures
ASP Forms
ASP Cookies
ASP Session
ASP Application
ASP #include
ASP Global.asa
ASP Send e-mail

ASP Objects
ASP Response
ASP Request
ASP Application
ASP Session
ASP Server
ASP Error

ASP FileSystem
ASP TextStream
ASP Drive
ASP File
ASP Folder
ASP Dictionary
ASP ADO

ASP Components
ASP AdRotator
ASP BrowserCap
ASP Content Linking
ASP Content Rotator

ASP Quick Ref
ASP Summary

Examples/Quiz
ASP Examples
ASP Quiz
ASP Exam

Selected Reading
Web Statistics
Web Glossary
Web Hosting
Web Quality

Browse Tutorials
 

ASP CreateObject Method


Server Object Reference Complete Server Object Reference

The CreateObject method creates an instance of an object. 

Note: Objects created with this method have page scope. They are destroyed when the server are finished processing the current ASP page. To create an object with session or application scope, you can either use the <object> tag in the Global.asa file, or store the object in a session or application variable.

Syntax

Server.CreateObject(progID)

Part Description
progID Required. The type of object to create

Example

Example 1

This example creates an instance of the server component MSWC.AdRotator:

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

Example 2

An object stored in a session variable is destroyed when the session ends. However, you can also destroy the object by setting the variable to Nothing or to a new value:

<%
Session("ad")=Nothing
%>
or
<%
Session("ad")="a new value"
%>

Example 3

You cannot create an instance of an object with the same name as a built-in object:

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


Server Object Reference Complete Server Object Reference



 
WEB HOSTING
Web charting
Cheap VPS Hosting
$10 Domain Name
Registration
Cheap Domain Names
Cheap Web Hosting
Amins Point
PHP MySQL Hosting
Top 10 Web Hosting
UK Reseller Hosting
Live Cricket Score
FREE Web Hosting
WEB BUILDING
Online Travel
Web development
EDUCATION
US Web Design Schools
HTML Certification
JavaScript Certification
XML Certification
PHP Certification
ASP Certification

Home HOME or Top of Page Validate   Validate   W3C-WAI level A conformance icon Printer Friendly  Printer Friendly

W3Schools is for training only. We do not warrant the correctness of its content. The risk from using it lies entirely with the user.
While using this site, you agree to have read and accepted our terms of use and privacy policy.
Copyright 1999-2009 by Refsnes Data. All Rights Reserved.