New Objects in ADO 2.5

[Previous] [Next]

ADO 2.5 extends the concept of universal data access into new areas with the Record and Stream objects.

Record Object

Not all data is rectangular like that in a Microsoft Excel spreadsheet. The Record object is designed primarily for interacting with document-based data-like file and directory structures. The Record object makes it possible for ADO to interact with data that resembles a hierarchical tree, such as the directories and files on a hard drive. A Record object can correspond to a row in a Recordset object, or it can represent an object in a hierarchy such as a file directory.

None of the "traditional" database providers or drivers included with Microsoft Data Access Components (MDAC) 2.5 support the Record object. In Chapter 6, we'll cover the Record object in more depth and show some examples of using the object with a couple of the providers that support it.

Stream Object

While the Record object can help you work with hierarchical directory structures, the Stream object lets you access the data stored in the hierarchy. For example, you can use the Record object to traverse through a file and directory structure on a hard drive via the OLE DB provider for Microsoft Active Directory Services. Then you can use the Stream object to retrieve the contents of the files that the Record object refers to.

However, it's not necessary to use the Record object and the Stream object together. The Record object is limited to a few nondatabase OLE DB providers with the release of MDAC 2.5, but you can use the Stream object with more traditional database applications. The Stream object exposes methods that make working with binary large object (BLOB) data such as SQL Server text and image fields much simpler than do the Field object's GetChunk and AppendChunk methods. (See Chapter 4 for more on these methods.) You can also use the Stream object to store Recordset objects rather than having to write them to your hard drive.

We'll discuss the Stream object in more depth in Chapter 6.



Programming ADO
Programming MicrosoftВ® ADO.NET 2.0 Core Reference
ISBN: B002ECEFQM
EAN: N/A
Year: 2000
Pages: 131
Authors: David Sceppa

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net