Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
ACC: Why OLE Objects Cause Databases to Grow
Article ID: 123151 - View products that this article applies to.
This article was previously published under Q123151
Advanced: Requires expert coding, interoperability, and multiuser skills.
A Microsoft Windows OLE object is stored as an OLE stream that consists of two portions:
The amount of information used to render the object is often greater than the size of the object itself. Adding such OLE objects can increase the size of a database significantly. To minimize size increases caused by adding OLE objects to a database, use either of these methods:
An object's rendering information can be in any of the following formats:
Typically, either WMF or DIB is chosen, because OLE servers render these formats most easily. For example, Microsoft Word for Windows typically renders using WMF, while Windows Paintbrush renders using DIB. An OLE client can always choose the format it prefers first. Because DIB is a form of BMP, most servers that render in DIB also render in BMP, although DIB is often offered first. Microsoft Access always chooses DIB over BMP.
OLE servers that can display pictures stored in other compressed formats, such as the JPEG format (JPG), must still send the two portions of information described earlier in this article. The server must send information to render the object using BMP, WMF, or DIB, as well as native data that can be used to edit the object. When this occurs, the compressed format is converted to a format to be rendered. The size of the OLE stream is the sum of the converted rendering object, the native data, and some OLE overhead information. Because the OLE stream contains all of this information, small objects in compressed formats can become quite large when stored in a Microsoft Access database.
One way to work around this behavior is to store the object as an icon. If you do not need to display the object in a Microsoft Access form or report, you can store the object as an icon that represents the object type. Storing an object as an icon causes the OLE server to send the object with rendering information consisting of only the icon rather than the complete object, using significantly less storage space in the database. When you double-click the icon, the OLE server is launched with the native data that the icon represents.
Another example of a small file growing to become a large OLE object is a Microsoft Word file that contains complex text formatting or an image on the first page of the document. The small amount of native data requires so much information for rendering that the OLE object is quite large. To work around this behavior, place a page with simple formatting at the beginning of the document, or store the document as an icon.
OLE has a preferred order for using the standard presentation formats. Regardless of where WMF appears in the format order, it is used if it is available (metafiles provide better scaling than bitmaps). If WMF is not available, DIB is preferred over BMP. OLE currently supports only WMF, DIB, and BMP.
One of the options in the OLE Specification calls for OLE servers to add more rendering formats to the three default formats that Windows supports. Microsoft Access does not currently support this OLE feature.
For more information about OLE Objects, search the Help Index for "OLE Objects," or ask the Microsoft Access 97 Office Assistant.
"Microsoft Object Linking and Embedding Programmer's Reference," Volume 1, pages 418-420
Article ID: 123151 - Last Review: January 19, 2007 - Revision: 2.1