Name

CreateObject — Set objMyObject = Server.CreateObject( strProgId )

Synopsis

Instantiates an object on the server. Once instantiated, this object's properties and methods can be used just as you can use the properties and methods of the built-in objects that come with ASP. The DLLs from which these objects are instantiated must be installed and registered on the web server machine separately from your installation of IIS.

Parameters

objMyObject

The name of a variable that will contain a reference to the object you are instantiating.

strProgId

The programmatic ID for the class from which you would like to instantiate an object. The format for the strProgId parameter is:

[LibraryName.]Component[.Version]

This value is found in the registry and represents how the component's DLL is registered there. Although it sometimes contains the DLL name, it often does not. For example, the DLL from which you instantiate the Ad Rotator object is adrot.dll. However, its ProgID is MSWC.AdRotator.1, as defined by the default value of the following registry key:

HKEY_CLASSES_ROOT\CLSID\{1621F7C0-60AC-11CF-9427-444553540000}\ProgID

As you will note, this is the ProgID for the registered DLL and contains version information in addition to its registered name. Sometimes, however, you may have several different versions of the same DLL registered on your machine. In this case, you can use the default value of the VersionIndependentProgID registry key to instantiate the most recent version of the DLL. In ...

Get ASP in a Nutshell, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.