OpenSChema method

xiaoxiao2021-03-05  23

OpenSChema method

Get database mode information from the provider.

grammar

Set Recordset = Connection.Openschema (QueryType, criteria, schemaid)

return value

Returns the RECORDSET object containing the mode information. Recordset will open read, static cursors.

parameter

The pattern query type to be running QueryType can be any constant.

Criteria is optional. The query limit condition array of each querytype option is listed below:

Criteria value QueryType value AdSchemaAsserts CONSTRAINT_CATALOGCONSTRAINT_SCHEMACONSTRAINT_NAME AdSchemaCatalogs CATALOG_NAME AdSchemaCharacterSets CHARACTER_SET_CATALOGCHARACTER_SET_SCHEMACHARACTER_SET_NAME AdSchemaCheckConstraints CONSTRAINT_CATALOGCONSTRAINT_SCHEMACONSTRAINT_NAME AdSchemaCollations COLLATION_CATALOGCOLLATION_SCHEMACOLLATION_NAME AdSchemaColumnDomainUsage DOMAIN_CATALOGDOMAIN_SCHEMADOMAIN_NAMECOLUMN_NAME AdSchemaColumnPrivileges TABLE_CATALOGTABLE_SCHEMATABLE_NAMECOLUMN_NAMEGRANTORGRANTEE adSchemaColumns TABLE_CATALOGTABLE_SCHEMATABLE_NAMECOLUMN_NAME adSchemaConstraintColumnUsage TABLE_CATALOGTABLE_SCHEMATABLE_NAMECOLUMN_NAME adSchemaConstraintTableUsage TABLE_CATALOGTABLE_SCHEMATABLE_NAME adSchemaForeignKeys PK_TABLE_CATALOGPK_TABLE_SCHEMAPK_TABLE_NAMEFK_TABLE_CATALOGFK_TABLE_SCHEMAFK_TABLE_NAME adSchemaIndexes TABLE_CATALOGTABLE_SCHEMAINDEX_NAMETYPETABLE_NAME adSchemaKeyColumnUsage CONSTRAINT_CATALOGCONSTRAINT_SCHEMACONSTRAINT_NAMETABLE_CATALOGTABLE_SCHEMATABLE_NAMECOLUM N_NAME adSchemaPrimaryKeys PK_TABLE_CATALOGPK_TABLE_SCHEMAPK_TABLE_NAME adSchemaProcedureColumns PROCEDURE_CATALOGPROCEDURE_SCHEMAPROCEDURE_NAMECOLUMN_NAME adSchemaProcedureParameters PROCEDURE_CATALOGPROCEDURE_SCHEMAPROCEDURE_NAMEPARAMTER_NAME adSchemaProcedures PROCEDURE_CATALOGPROCEDURE_SCHEMAPROCEDURE_NAMEPROCEDURE_TYPE adSchemaProviderSpecific see instructions adSchemaProviderTypes DATA_TYPEBEST_MATCH adSchemaReferentialConstraints CONSTRAINT_CATALOGCONSTRAINT_SCHEMACONSTRAINT_NAME adSchemaSchemata CATALOG_NAMESCHEMA_NAMESCHEMA_OWNER adSchemaSQLLanguages ​​

adSchemaStatistics TABLE_CATALOGTABLE_SCHEMATABLE_NAME adSchemaTableConstraints CONSTRAINT_CATALOGCONSTRAINT_SCHEMACONSTRAINT_NAMETABLE_CATALOGTABLE_SCHEMATABLE_NAMECONSTRAINT_TYPE adSchemaTablePrivileges TABLE_CATALOGTABLE_SCHEMATABLE_NAMEGRANTORGRANTEE adSchemaTables TABLE_CATALOGTABLE_SCHEMATABLE_NAMETABLE_TYPE adSchemaTranslations TRANSLATION_CATALOGTRANSLATION_SCHEMATRANSLATION_NAME adSchemaUsagePrivileges OBJECT_CATALOGOBJECT_SCHEMAOBJECT_NAMEOBJECT_TYPEGRANTORGRANTEE adSchemaViewColumnUsage VIEW_CATALOGVIEW_SCHEMAVIEW_NAME adSchemaViewTableUsage VIEW_CATALOGVIEW_SCHEMAVIEW_NAME adSchemaViews TABLE_CATALOGTABLE_SCHEMATABLE_NAMESchemaID OLE DB specification does not define a pattern GUID provider queries. If QueryType is set to Adschemaproviderspecific, this parameter is required, otherwise it is not used.

Description

The OpenSchema method returns information related to the data source, such as information about the table on the server and the columns in the table.

The criteria parameter is an array of values ​​that can be used to restrict the results query results. Each mode query has different parameter sets it supports. The actual mode is defined by the OLE DB specification under the IDBSChemarowSet interface. The parameter set supported in the ADO is listed above.

If the provider defines the non-standard mode query not listed above, the constant ADSCHEMAPROVIDERSPECIFIC will use the querytype parameter. The GUID that requires the schemaid parameter transfer mode query is required when using this constant for execution. If QueryType is set to Adschemaproviderspecific but does not provide schemaid, it will cause errors.

The provider does not need to support all OLE DB standard mode queries, only ADSCHEMATABLES, AdsChemacolumns, and AdschemaprovideTypes are the OLE DB specification. But for these mode queries, the provider does not need to support the criteria condition constraints listed above.

Remote Data Services OpenSchema is invalid on the client Connection object.

Note In Visual Basic, 4-byte unsigned integer (DBTYPE UI4) in the Recordset returned from the OpenSchema method of the Connection object cannot be compared with other variables. For more information on OLE DB data types, see Chapters and Appendix A of the Microsoft OLE DB Programmer Reference.

转载请注明原文地址:https://www.9cbs.com/read-35241.html

New Post(0)