Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    ole object (access 97)

    I need to display photographs on a form and print them on a report. I have to embed the images because the .mdb will be sent to other users who cannot access the source of the photos. I am concerned with database bloat. I have been embedding .jpg files in my .mdb and they are adding roughly 1mb for each 30kb .jpg file. If I embed using Display as Icon the bloat is not nearly as bad, but I need to be able to print the images and I can't figure out how to if they are inserted as icons. Any suggestions? Would other file formats work better? Is there a way to print the image even though it has been stored as an icon?

  2. #2
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ole object (access 97)

    When images get inserted into a DB, it will definitely bloat the db.

    What you may want to consider is instead of directly inserting the images into the db, you use the GetChunk/AppendChunk methods of writing the data that is the image. It adds much less overhead to the OLE field.

    If you goto http://members.tripod.com/accdevel/imaging.htm you will find a sample DB, one for 97 and one for 2K, with an article with the download that talks about 3 different ways to deal with images in Access. One of them is the GetChunk/AppendChunk method
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  3. #3
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Chicago, Illinois, USA
    Posts
    116
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: ole object (access 97)

    Thanks Bryan, I haven't tried it yet but it looks like it will work!

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ole object (access 97)

    As Bryan remarked, storing images in a database will cause serious database bloat. You can keep the images as separate files, and store their file names in the database (without the path). It's not hard to write code that loads the images into a form or report using a relative path; it's easier than GetChunk/AppendChunk.
    If you use this method, you can distribute the database together with the image files (in a zip file for instance).

    Charlotte has posted a sample database in <post#=126927>post 126927</post#> that demonstrates this technique.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •