FIGURE 9.15
A form with data loaded from a text file, using the FileSystemObject method.
Working with Attachment Fields ......................................................................................
The Attachment data type discussed in this section is new to Access 2007.
Previous versions of Access had an OLE Object field data type, which only supported certain types
of objects and was quite cumbersome to use (not to mention causing terrible database bloat). By
contrast, in Access 2007, it is quite easy to store files of any type in a field of the new Attachment
data type, and the attachments are automatically compressed to save database space. The Contacts
form, frmContactsWithAttachments (opened from the Browse Contacts button on the main menu)
has such a field. If an attachment has already been added to the field, it shows as an icon (at least,
if it is of a type recognized by Office); Figure 9.16 shows a record with a Word 2007 document
attachment.
The attachment icons differ according to the Office version of the stored attachment
file. A Word document’s icon has a Word document with a W image over the upper-left
corner; the style of the W differs for Word 97-2003 (.doc) or Word 2007 (.docx) documents. For a
Word 2007 document, the W is similar to the one displayed in a Word 2007 document’s taskbar icon;
for Word 97-2003 documents, the W is the older style W that was used as the Word icon in Office 97.
Other Office documents also have different icons depending on their version.
NOTENOTE
NEW FEATURENEW FEATURE
Working with Files and Folders 9