Instantiating Active Data Objects

To create an object variable containing an instance of an Active Data object, use the CreateObject method of the Server object. The syntax for the CreateObject method is:

Set objMyObject = Server.CreateObject(strProgId)

where the parameters are as follows:

objMyObject

The name of the object variable created using the CreateObject method of the Server object.

strProgId

The programmatic identifier (ProgId) of the component you are trying to instantiate. Table 12.1 lists the available Active Data Objects and their corresponding ProgIds.

Table 12.1. Active Data Objects

Active Data Object

ProgId

Command

ADODB.Command

Connection

ADODB.Connection

Error

ADODB.Error

Field

ADODB.Field

Parameter

ADODB.Parameter

Property

ADODB.Property

Record

ADODB.Record

Recordset

ADODB.Recordset

Stream

ADODB.Stream

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.