FUNCTION:  CreateObject( )

CreateObject(ServerName.TypeName, RemoteServerName)
 
The CreateObject function is used to create an object of the type specified in the argument.
 
The Set statement assigns the object reference to a variable or property. The keyword Nothing is used to unassign the object reference from the variable or property. Good programming techniques require that you unassign all objects before you exit the program.
 
There one mandatory and one optional argument.
 
ServerName.TypeName
 
ServerName is the name of the application that provides the object. TypeName is the type (class) of object to be created.
 
RemoteServerName
 
The optional RemoteServerName argument was added in verson 5.0 and is used to create an object on a remote server. It is the name of the remote server. To use this argument, the internet security must be turned off.
 
In this first example, we create an instance of Microsoft Word.
 
Code:
<%
Set objWrd = CreateObject("Word.Application")
...
' Place any code you desire here
...
Set objWrd = Nothing
%>

 
In this second example, we create an object on a remote site.
 
Code:
%lt%
Set objFarAway = CreateObject("Word.Application", "FarAwayServerName")
...
' Place any code you desire here
...
Set objFarAway = Nothing
%>


Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information