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 IDBSchemaRowset 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.
#include <atldbsch.h>
See Also