MDAC 2.5 SDK - OLE DB Programmer's Reference
Chapter 4: Rowsets


 

Views

By creating a view object, providers that do not support full command syntax can still expose simple operations such as sorting or filtering a rowset. Views can be applied when opening a rowset, or they can be applied to an existing rowset to return either a new chapter on that rowset or a completely new rowset with the additional functionality. OLE DB view objects are not equivalent to SQL-92 views and cannot be used to combine multiple results.

Views are similar to commands, with the following restrictions:

View operations are expressed through method calls as opposed to textual statements.

   CoType TView {
      [mandatory]   interface IColumnsInfo;
      [optional]    interface IAccessor;
      [optional]    interface ISupportErrorInfo;
      [optional]    interface IViewChapter;
      [optional]    interface IViewFilter;
      [optional]    interface IViewRowset;
      [optional]    interface IViewSort;
   };

Views are created either by applying a view when opening a rowset or by applying a view to an existing rowset. A view object may be returned in place of a rowset when executing any rowset-returning method.

Providers that expose IViewFilter on the view object must also expose IAccessor and IColumnsInfo on the view object. Consumers should use only accessors created on the view object to get or set filters.

Note   To work with ADO 2.1 or later, for views created from existing rowsets (by calling IRowsetView::CreateView), the view object must allow the use of accessors created on the rowset from which the view was created.