I'm learning Access 2007, and among the list of data types are the OLE Object and the Attachment.
The text has this to say about Attachments:
You can use attachments to store several files, and even different types of files, in a single field. The Attachment field is new for Access 2007 and stores data files more efficiently than us开发者_开发问答ing other fields like the OLE Object field.
More efficiently than OLE Objects?
What is the purpose and proper use of the Attachment data type? And how is it related to the OLE Object?
WHY THE OLE OBJECT IS A BETTER SOLUTION THAN THE ACCESS ATTACHMENT DATA TYPE The default user interface for the OLE Object storage system is clumsy. The attachment data field introduced in Access 2007 has an improved user interface making it easier to work with different file types. Unfortunately, beginning in Access 2013 and continuing in Access 2016, Microsoft developed a fatal glitch that they have not addressed with a Windows update. If you have saved a Microsoft Word document in an Access Attachment field, you can edit the Word Document, but it cannot be saved in Access. When you click 'Save' you are prompted to save the document to a file. It won't save to the Access database. Other file types will save to the database such as Excel spreadsheets.
Because of this Microsoft glitch, I was forced to develop an improved user interface for the OLE Object data field. In a nutshell, it is a one to many relationship table that saves the file name and file in an OLE Object data field. The user interface opens file explorer to add the file. I use ShellExucute to open the document via Windows which has much more flexibility to file types than the Access default user interface.
The Access Attachment data type is limited to Microsoft Access databases. The OLE Object data type can be migrated to an SQL Server database where the content within the stored documents can be searched with an SQL Server query. A lot of power there! Just my opinion.
Not an exhaustive answer, but I recently tried to use an OLE object
field to store images to be printed through a report.
To make the story short, it does not work very easily, and is restricted to 2 little used image formats.
Using an Attachment
field, it works like a charm and you can use .PNG files as well.
Note 1: Attachment
is NOT available in .MDB so I had to migrate to ACCDB.
Note 2: OLE Object
field can be migrated to SQL Server, Attachment
field cannot
Judging from this description, I would say that it is some sort of native binary field.
OLE Object fields were really just containers for OLE objects. They suffered from considerable bloat, and were clumsy to use.
精彩评论