ASP » Server » CreateObject

Syntax:
Server.CreateObject(ObjectID)
ObjectID
The ObjectID argument specifies the type of object to be created.

The CreateObject method creates an instance of an object to use in an Active Server Page.

The CreateObject method is probably the most widely used and the most important method available through the Built-in Active Server Pages Objects. It allows you to instantiate the components of a script, or in different terms, create an instance of other objects. As a direct consequence, you can use and access any collections, events, methods, and properties associated with these objects.

There is one mandatory argument.

Examples

Code:
<%
Set myconn = Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
%>
Explanation:

The code creates a connection to an Access database