Getting a List Object

A list object includes a group of specific objects. Like all objects, a list object has properties and methods.

Visual Basic

For a list method named ListObjects, use the following syntax to refer to a list object:

Parent.ListObjects

For example, to refer to the ListStartupProcedures list (of StoredProcedure objects) of a SQLServer object:

oSQLServer.ListStartupProcedures

The StoredProcedure objects in this list are contained in the Database.StoredProcedures collection.

C++

Use the ListObjects list method to get a list object from the parent object. Pass the address of a list object variable (use the address of & operator) of the appropriate type (LPSQLOLEOBJECTLIST) to the ListObjects function. The ListObjects function will write the list object pointer to your object variable. Use the following syntax:

pParent->ListObjects ( &pObjectList );

For example, to use the ListStartupProcedures list method to get a StoredProcedure list from a SQLServer object:

LPSQLOLESTOREDPROCEDURELIST pStoredProcedureList;
pSQLServer->ListStartupProcedures (&pStoredProcedureList);

The StoredProcedure objects in this list are contained in the Database.StoredProcedures collection.