Database Reference
In-Depth Information
Figure 11-14
rowset Interfaces
IRowSet
Methods for sequential iteration through a rowset
IAccessor
Methods for setting and determining bindings between rowset
and client program variables
IColumnsInfo
Methods for determining information about the columns in the rowset
Other interfaces
Scrollable cursors
Create, update, delete rows
Directly access particular rows (bookmarks)
Explicitly set locks
Additional capabilities
A service provider , in contrast, is a transformer of data. Service providers accept OLE
DB data from an OLE DB tabular data provider and transform it in some way. Service provid-
ers are both consumers and providers of transformed data. An example of a service provider
is one that obtains data from a relational DBMS and then transforms them into XML docu-
ments. Both data and service providers process rowset objects. A rowset is equivalent to what
we called a cursor in Chapter 9, and in fact the two terms are frequently used synonymously.
For database applications, rowsets are created by processing SQL statements. The results
of a query, for example, are stored in a rowset. OLE DB rowsets have dozens of different meth-
ods, which are exposed via the interfaces listed in Figure 11-14.
IRowSet provides object methods for forward-only sequential movement through a
rowset. When you declare a forward-only cursor in OLE DB, you are invoking the IRowSet
interface. The IAccessor interface is used to bind program variables to rowset fields.
The IColumnsInfo interface has methods for obtaining information about the columns in
a rowset. IRowSet, IAccessor, and IColumnsInfo are the basic rowset interfaces. Other inter-
faces are defined for more advanced operations such as scrollable cursors, update operations,
direct access to particular rows, explicit locks, and so forth.
ADO and ADO.NET
Because OLE DB is an object-oriented interface, it is particularly suited to object-oriented lan-
guages such as VB.NET and Visual C#.NET. Many database application developers, however,
program in scripting languages such as VBScript or JScript (Microsoft's version of JavaScript).
To meet the needs of these programmers, Microsoft developed Active Data Objects (ADO) as
a cover over OLE DB objects, as shown in Figure 11-15. ADO has enabled programmers to use
almost any language to access OLE DB functionality.
ADO is a simple object model that overlies the more complex OLE DB object model. ADO
can be called from scripting languages, such as JScript and VBScript, and it can also be called
from more powerful languages, such as Visual Basic .NET, Visual C#.NET, Visual C++.NET, and
even Java. Because ADO is easier to understand and use than OLE DB, ADO was (and still is)
often used for database applications.
ADO.NET is a new, improved, and greatly expanded version of ADO that was developed
as part of Microsoft's .NET initiative. It incorporates the functionality of ADO and OLE DB, but
 
Search WWH ::




Custom Search