Schema Rowset Classes and Typedef Classes

A schema is a collection of database objects that are owned, or have been created by, a particular user. A catalog can contain one or more schemas, but must always contain a schema called INFORMATION_SCHEMA, which contains the views and domains of the information schema. Schema information in OLE DB is retrieved using predefined schema rowsets, and includes types, tables, columns, indexes, views, assertions and constraints, statistics, character sets, collations, and domains.

Schema rowsets are predefined rowsets representing metadata. Schema rowsets are generally used in dynamic programming, where the database structure is not known at compile time. You can use these schema rowsets to obtain information about a database at run time.

Use the typedef classes to instantiate the schema rowsets. The corresponding typedef and schema rowset classes are listed below. You must call CRestrictions::Open after you have created an instance of the schema rowset. This method returns a result set based on the restrictions you specify. See for information on restriction columns associated with each schema rowset.

The following table displays each OLE DB Schema Rowset and its corresponding OLE DB Templates typedef class and info class.

OLE DB Schema Rowset Typedef class Info class
CAssertions CAssertionInfo
CCatalogs CCatalogInfo
CCharacterSets CCharacterSetInfo
CCollations CCollationInfo
CColumnPrivileges CColumnPrivilegeInfo
CColumns CColumnsInfo
CConstraintColumnUsage CConstraintColumnUsageInfo
CConstraintTableUsage CConstraintTableUsageInfo
CCheckConstraints CCheckConstraintInfo
CColumnDomainUsage CColumnDomainUsageInfo
CForeignKeys CForeignKeysInfo
CIndexes CIndexInfo
CKeyColumnUsage CKeyColumnUsageInfo
CPrimaryKeys CPrimaryKeyInfo
CProcedures CProcedureInfo
CProcedureColumns CProcedureColumnInfo
CProcedureParameters CProcedureParameterInfo
CProviderTypes CProviderInfo
CReferentialConstraints CReferentialConstraintInfo
CSchemata CSchemataInfo
CSQLLanguages CSQLLanguageInfo
CStatistics CStatisticInfo
CTableConstraints CTableConstraintInfo
CTables CTableInfo
CTablePrivileges CTablePrivilegeInfo
CTranslations CTranslationInfo
CUsagePrivileges CUsagePrivilegeInfo
CViewColumnUsage CViewColumnInfo
CViews CViewInfo
CViewTableUsage CViewTableInfo

#include <atldbsch.h>

See Also

CRestrictions