OLE datatype

Posted on 2011-04-28
Last Modified: 2016-05-16
I have a question about using the OLE datatype in Access 2007. So if I drag and drop an image into an OLE datatype column, the image will be stored as a package. But when I create a program and store an image into an OLE datatype column programmatically, the image will be stored as long binary data.

Whats the difference? Are they stored different? Are there any conversion involved?

When storing it by drag-and-drop, the extraction resulted in blank images.
It extraction works fine when I store the images programmatically.
Question by:huBelial
    LVL 26

    Expert Comment

    You stand upon the brink of great and painful evil.
    Don't use OLE data types.
    Don't use the new-fangled attachment types either.

    Store your images in folders, save the path in a table and use the .Picture property of Image controls to use them
    Google it.  Nobody recommends what you are attempting.

    Author Comment

    I understand but I still want to know why its doing that.
    LVL 26

    Assisted Solution

    I think this explains things
    LVL 26

    Accepted Solution

    If stuff gets stored as packages, by rights the appropriate program is supposed to open when you double-click it.
    Long binary data doesn't work with a double-click because Access didn't know from what program created it, and therefore can't fire it up.

    The OLE servers are fussy monsters though--especially for images.  The MS Picture Manager is the prefered server.  If it isn't installed, double-clicking doesn't play nice.  Sometimes drag-and-drop looks like it works, but doesn't and is just corrupt data.

    With the long binary data, nothing corrupts it, and you are pulling it out progammatically, so it works.

    Just don't do it!

    Author Comment

    I retrieve the images programmatically so the double-click doesn't really apply in my case.  
    LVL 26

    Expert Comment

    You asked
    <So if I drag and drop an image into an OLE datatype column, the image will be stored as a package.>

    I explained :)

    OLE Filters and servers are fussy things.  When you do it programmatically these are mostly bypassed or controlled.
    LVL 74

    Assisted Solution

    by:Jeffrey Coachman
    <I understand but I still want to know why its doing that.>
    Then you will have to tell us a bit about how you are doing this "Problematically"

    I, like Nick67, have long since given up on figuring out why OLE fields sometimes behave erratically....

    I use something like this (Linking to the image path) and have never had to worry about Packages, Binary files, BLOBS, Compression, File associations, Extraction issues, Bloat ...or any of the myriad of OLE errors...
    (Basically only one line of code to do this: Me.ctlImage.Picture = Me.txtImgLocation)



    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Join & Write a Comment

    QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
    Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

    728 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

    21 Experts available now in Live!

    Get 1:1 Help Now