次の方法で共有


Row Objects (OLE DB)

Row objects make rows available as first-class objects that can exist independently of rowsets. In addition, the row object provides an alternative binding mechanism to the accessor model. Using row object interfaces, the consumer can navigate to the desired row in a rowset and access its columns directly, without creating an accessor object.

The row object provides an efficient way to model a singleton SQL SELECT statement. Otherwise, the consumer would have to create a rowset to get the results of a singleton SELECT. Whether it is simpler or more efficient for a consumer to use row objects instead of rowsets depends on the application scenario.

Row and rowset objects can be used together. For example, a row can contain a rowset as one of its column values. Or a row object created from a row in a rowset can have its own schema that adds row-specific columns to the columns defined by the source rowset.

Rowset column ordinals start at 1 and are numbered sequentially in increasing order (for example, 1, 2, 3, and so on). When a row object is derived from a rowset, the row-specific column ordinals must come after the rowset column ordinals.

Hierarchies of row and rowset objects can also be used to model collections of related nodes in tree-structured namespaces, such as directories in a file system or messages in an e-mail system. These hierarchies can be used not only to access hierarchical data in read-only mode but also to manipulate the underlying resource tree and its contents. Just as an OLE DB consumer can change the rows in a rowset and transmit those changes to the underlying data store, it can also create new objects in a tree-structured namespace, such as directories and e-mail folders. Or it can move, copy, or delete entire subtrees by calling methods on the appropriate row objects.

If IBindResource::Bind is called, updatability of the row (whether or not the row exposes IRowChange) depends on the bits of dwBindURLFlags. Otherwise, if a row is obtained from a source rowset using IGetRow::GetRowFromHROW, or if a row is obtained from a parent row using IRow::Open, the updatability of the row is inherited from the source rowset or the parent row.

This topic is a part of:

This section contains the following topics: