Name

Connection.OpenSchema — (Versions 2.0, 2.1, 2.5, 2.6)

Synopsis

Set recordset = connection.OpenSchema(Schema, Criteria, SchemaID)

The OpenSchema method returns a Recordset object containing information about the data source’s schema.

Arguments

Schema (SchemaEnum)

Indicates the type of schema the OpenSchema method will provide in the returned Recordset object.

SchemaEnum contains the enumeration values listed in Table F-1.

Criteria (Variant Array)

Optional. Indicates which constraint columns to use for the Schema requested. A list of each available constraint column for each schema type is listed in Table G-1.

SchemaID (Long)

Optional. Represents a GUID of a provider-specific schema query. If the Schema parameter is set to adSchemaProviderSpecific (-1), then this parameter is mandatory; otherwise, it is not used.

Description

The OpenSchema method is used to obtain information about a data source’s structure -- its schema.

By setting the Schema parameter to a SchemaEnum value, ADO can determine which information the application is requesting. In addition, the Criteria parameter can be set to narrow the search. For instance, by passing the adSchemaTables enumeration value, the OpenSchema method will only return the table names.

Some providers may support their own schema query types. To use this feature, set the Schema parameter to adSchemaProviderSpecific, and set the SchemaID parameter to the GUID of the provider-specific schema query. If the Schema parameter is set to the adSchemaProviderSpecific ...

Get ADO: ActiveX Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.