The IServer::CreateObject method creates an instance of a server component. For more information, see the CreateObject method of the Server object.
HRESULT CreateObject(
BSTR bstrProgID, // contains the progID of the component
IDispatch ** ppDispObject
//pointer to an IDispatch interface pointer
);
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 attribute to SESSION or APPLICATION, or store the object in a session or application variable.