Data Access with ADO

Accessing data is the reason why we use databases, and a large proportion of your programming will usually revolve around manipulating those objects that deal with data: views, stored procedures, and recordsets.

The ADO Object Model

Figure 7-3

ADO actually supports two additional objects not shown in Figure 7-3: the Record and Stream objects.

The Record object can be seen as a single-row recordset. Although records have a limited functionality when compared to recordsets, they relieve you of the overhead of having to instantiate the more complex recordset. In addition, they have different properties and methods that can be quite useful.

The Record object can also manipulate data such as folders and files in a file system, e-mail messages, and so on. That means the source of data for the Record object can be the current row of a recordset, a Uniform Resource Locator (URL).

The Stream object reads, writes, and manages a stream of bytes. This byte stream can be text or binary, and is limited in size only by the available system resources.

You would typically use an ADO stream object to contain the text or bytes of a file or message supplied using a provider such as the Microsoft OLE DB Provider for Internet Publishing.

The data source for a stream object can be a file whose location is specified by a URL, a field in a record or recordset that contains a stream object, a resource field containing the URL of a file, a BLOB field in a recordset, or a custom-designed stream that exists in memory.

Unfortunately, an in-depth study of these objects is beyond the scope of this book. So if you wish to examine these objects in greater detail, consult your provider's documentation and the Access help.

0 0

Post a comment