Chapter 7: BLOBs and COM Objects

OLE DB Programmer's Reference

Some providers support the storage and retrieval of binary large objects (BLOBs) in rowsets. To the provider (and thus the rowset), a BLOB is a sequence of uninterpreted bytes. The consumer is responsible for interpreting the contents of the BLOB. The provider is responsible only for providing the mechanism or mechanisms with which the consumer stores and retrieves BLOBs and COM objects. Whether a provider supports BLOBs and COM objects is provider-specific.

This chapter discusses ways to access BLOB data as in-memory data, storage objects, and columns. In-memory data is treated as a sequence of bytes sent or retrieved in one piece. A storage object—that is, a COM object that exposes a storage interface such as ISequentialStream, IStorage, or ILockBytes—can be retrieved or sent in pieces. The rows in the rowset act as containers for the storage objects. A specialized type of storage object exposed by the COM interface IStream, called an OLE DB stream object, is described in Chapter 9: Row and Stream Objects.

This chapter also discusses limitations and lifetimes of storage objects. COM objects—for example, objects that support IPersist* interfaces—can also be stored in columns in a rowset. The manipulation, update semantics, and transaction considerations of IPersist* objects are explained in this chapter.

For more information on Go to
Accessing BLOB data "Accessing BLOB Data" in this chapter
In-memory data "BLOBs as In-Memory Data" in this chapter
Storage object "BLOBs as Storage Objects" in this chapter
Rowsets Chapter 4: Rowsets
Limitations and lifetimes of storage objects "Limitations of Storage Objects" in this chapter

"Lifetime of Storage Objects" in this chapter

IPersist* objects "IPersist* Objects" in this chapter

OLE DB defines handling of the following kinds of objects:

  • BLOB—An uninterpreted sequence of bytes or characters. There is no behavior encapsulated in a BLOB. All the logic for interpreting a BLOB is in the consumer. The type indicator of a BLOB column is DBTYPE_BYTES, DBTYPE_STR, or DBTYPE_WSTR.
  • IPersist* object—A COM object that exposes IPersistStream, IPersistStreamInit, or IPersistStorage. The type indicator of an IPersist* column is DBTYPE_IUNKNOWN.

The consumer can determine what types of BLOBs and COM objects a provider supports by calling IDBProperties::GetProperties, passing the DBPROP_OLEOBJECTS property as a parameter.

1998-2001 Microsoft Corporation. All rights reserved.



Microsoft Ole Db 2.0 Programmer's Reference and Data Access SDK
Microsoft OLE DB 2.0 Programmers Reference and Data Access SDK (Microsoft Professional Editions)
ISBN: 0735605904
EAN: 2147483647
Year: 1998
Pages: 1083

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