ADO OpenSchema Method

Definition and Usage

The OpenSchema method returns a Recordset object that contains information about the schema of the data source. For example, schema information can include the names of tables, column names in the table, and the data type of each column. The Recordset will be opened in a read-only, static cursor mode.

Syntax

Set rs = objconn.OpenSchema(querytype, criteria, schemaid)
Parameter Description
querytype

Required. Any SchemaEnum Value indicating the type of schema query to be executed.

Note: The OLEDB specification only requires support for three SchemaEnum values: adSchemaTables, adSchemaColumns, and adSchemaProviderTypes.

criteria Optional. An array of query constraints for each QueryType option, as listed in SchemaEnum.
schemaid GUID for provider mode query not defined by OLE DB specification. If QueryType is set to adSchemaProviderSpecific, this parameter is required. Otherwise, it will not be used.