How do I input/output an attachment data type in Access 2007 to an Oracle data type in 10g?

Posted on 2011-04-20
Last Modified: 2012-05-11
I am in the process of migrating an Access 2007 database to an Oracle 10g database and ran into an issue with one of the field conversions.

In Access I have some Attachment fields that hold Microsoft word .docx files. I used SQL Developer to do the migration and it suggested using the Blob datatype in Oracle 10g. Access crashes when trying to retrieve the Blob because it does not know how to see this type. What would some code be for converting the attachment to a blob and converting the blob back into an attachment. I have found nothing online for this. It is key that the Word documents are held in this database.
Question by:kkusic1
    LVL 22

    Assisted Solution

    by:Nico Bontenbal
    Seems like you are not the only one with this problem. Try this on Google:
    "ms access" blob
    LVL 56

    Accepted Solution


      In the past, BLOB's in JET were gotten with the GetChunk() method in DAO (and put in with the corresponding AppendChunk()).

      However the Attachment field type is one of those new MVF (Multi Value Fields), which Access does by creating a hidden system table in the DB (they are a many to one relationship with the main record even though it appears in the main field).

      All I could find yesterday was an importattach command.  I would assume there is an export as well, but I couldn't verify that and ran out of time.

      I also saw that FMS Total Source Book contained routines to read attachments, so it must be doable.

      And you will need to use an Access command of some type to get at them because Access compresses the data when it stores it (no OLE wrapper like in times past though), and your going to want just the un-compressed data.  So directly reading the BLOB field with GetChunk() won't be workable.

    LVL 26

    Assisted Solution

    Have a quick look at these questions
    I've been working with @chovis78 on resizing pictures that he spits back out of an attachment type.

    Clearly, he and those he's working with know how to get attachments back out of a DB
    @fyed's got a sample in the second question to work with

    Once they're out, ramming them into Oracle
    <It is key that the Word documents are held in this database.>
    and not in a folder with a pointer to a path in the Oracle database is a different piece of the puzzle

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This article is a continuation or rather an extension from Cascading Combos ( and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
    Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
    Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    729 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now