다음을 통해 공유


IDBSchemaRowsetImpl::SetRestrictions

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at IDBSchemaRowsetImpl::SetRestrictions.

Specifies which restrictions you support on a particular schema rowset.

Syntax

  
      void SetRestrictions(  
   ULONG cRestrictions,  
   GUID* /* rguidSchema */,  
   ULONG* rgRestrictions   
);  

Parameters

cRestrictions
[in] The number of restrictions in the rgRestrictions array and the number of GUIDs in the rguidSchema array.

rguidSchema
[in] An array of the GUIDs of the schema rowsets for which to fetch restrictions. Each array element contains the GUID of one schema rowset (for example, DBSCHEMA_TABLES).

rgRestrictions
[in] An array of length cRestrictions of restriction values to be set. Each element corresponds to the restrictions on the schema rowset identified by the GUID. If a schema rowset is not supported by the provider, the element is set to zero. Otherwise, the ULONG value contains a bit mask that represents the restrictions supported on that schema rowset. For more information on which restrictions correspond to a particular schema rowset, consult the table of schema rowset GUIDs in IDBSchemaRowset in the OLE DB Programmer's Reference in the Windows SDK.

Remarks

The IDBSchemaRowset object calls SetRestrictions to determine which restrictions you support on a particular schema rowset (it is called by GetSchemas through an upcasted pointer). Restrictions allow consumers to fetch only matching rows (for example, find all the columns in the table "MyTable"). Restrictions are optional, and in the case in which none are supported (the default), all data is always returned.

The default implementation of this method sets the rgRestrictions array elements to 0. Override the default in your session class to set restrictions other than the default.

For information on implementing schema rowset support, see Supporting Schema Rowsets.

For an example of an provider that supports schema rowsets, see the UpdatePV sample.

For more information on schema rowsets, see IDBSchemaRowset in the OLE DB Programmer's Reference in the Windows SDK.

Requirements

Header: atldb.h

See Also

IDBSchemaRowsetImpl Class
IDBSchemaRowsetImpl Class Members
Schema Rowset Classes and Typedef Classes
Supporting Schema Rowsets
UpdatePV