RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TADOConnection.OpenSchema Method

Retrieves schema information from the connection's provider.

Pascal
procedure OpenSchema(const Schema: TSchemaInfo; const Restrictions: OleVariant; const SchemaID: OleVariant; DataSet: TADODataSet);
C++
__fastcall OpenSchema(const TSchemaInfo Schema, const OleVariant Restrictions, const OleVariant SchemaID, TADODataSet DataSet);

Call OpenSchema to open a connection and retrieve schema information from the associated provider. OpenSchema retrieves the schema information in the form of a recordset that can then be accessed through an ADO dataset component. 

The Schema parameter is the type of schema information to retrieve, or in ADO terms, the query type. 

The Restrictions parameter is an array of query constraints for the specified type of schema information. This lists the type of information requested for the entity specified by Schema. In ADO terms, the elements of the array list the criteria for the query type. 

SchemaID is the GUID for a provider-schema schema query not defined by the OLE DB specification. This parameter is required if the Schema parameter is set to siProviderSpecific, otherwise it is not used. 

DataSet is the ADO dataset component (such as a TADOTable) into the Recordset property of which the schema information is retrieved and through which the information is subsequently accessed. After OpenSchema loads the ADO dataset component with the schema information, use the standard navigation methods like First and Next to traverse the rows of data. Use the Fields property or the FieldByName method of the dataset component to read the value of any one column. Alternately, the schema data may be displayed using visual data-aware controls and a TDataSource. 

 

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!