599CD.com Eight New Handbooks Posted   Collapse Menus
 
 
NEW Courses - Excel 2007 Level 4 & 5, Access Security dismiss
 
   
 

What's New?  |  Courses  |  Theater  |  Demo  |  Tips  |  Blog  |  Forums  |  Search  |  Help  |  Order

 
What do you want to learn today? 
  Richard's 599CD Blog      home   history   comments   notify me   admin  

599CD on Facebook  599CD on Twitter  Subscribe to RSS Feed  Add to Live Bookmarks  Add to My AOL  Add to MyYahoo  Add to Google Reader or Homepage    hide help

<< First   |  < Previous   |  Next >   |  Last >>

10/6/2009 8:25:51 PM
Access Object Linking (OLE) File Sizes   

We were having this discussion in my Microsoft Access Forum, but I know a lot of you who are interested in Access don't follow the forums, so I figured I'd post it here. Hint: you should subscribe to the forum. :)

I just did some more research on Access and OLE (Object Linking & Embedding) with large files.

One of my good clients, Dave, said he's trying to link PDF files into his Access tables, and they're still blowing his tables up in size. So I did some investigating.

I did this with both Access 2003 and 2007, and the file sizes are a little different, but both results came out about the same. This time instead of small files, I used a couple of larger ones.

First, I started with a blank database that was 304k. I took a PDF file that was 6133k (about 6 MB) and embedded it into the table. The database blew up to 12364k, and only compacted down to 12340k. Wow!

Then I tried LINKING the same PDF file. The database grew to 6148k and only compacted down to 6124k. So basically, we didn't save much space at all.

It gets even stranger with a BMP (Bitmap) file. I embedded a 6751k BMP file and the database expanded to 7120k. It compacted down to 7120k.

Now here's the REALLY wierd part: when I LINKED the BMP file into the Access 2007, the database shot way up to 13968k and compacted at 13994k. That means it's actually TWICE as large just LINKING to the picture as it was embedding it!

With the Access 2003 database, the linked BMP compacted way down to 116k. So obviously Access 2003 and 2007 databases are handling the BMP files differently since one blew up gigantically, and the older database handled it just fine. Odd.

I tried the same thing with a 752k JPG file. This time BOTH databases compacted just fine, down to 332k. So apparently they were able handle the JPG images just fine.

What's going on here? Well, the research I've done on Microsoft's (and other) web sites has indicated that Access's OLE isn't very efficient at storing large amounts of binary data. Some objects store just fine. Others create incredible "database bloat" due to overhead associated with that file type.

In a nutshell, not only is Access storing binary data for that object but also information on how to work with that data. This can sometimes cause the database to skyrocket in size. And, it seems that the more compressed some objects are (like ZIP files) the larger the overhead that's required to store them in the database. One web site reports that one ZIP file blew up 10,000 TIMES its original size when dropped into an Access table. I haven't tested this myself, but my testing with BMPs and PDFs makes it plausible.

So LINKING to objects in your Microsoft Access tables might not always be the best solution for you. If you have hundreds or thousands of pictures, PDFs, videos, or other objects you need to store, you might be better off saving those files on your PC in a folder somewhere, and then using a TEXT FIELD to store the full pathname to that file in the database. Like:

  C:\Documents\MyBigPicture.JPG

You can then use an unbound image control or picture control and display that picture using some VBA code. The files need to be where everyone who is using the database can get to them. So if you are on a network, you will need to store them in a shared network folder:

  \\SERVER\Shared\MyBigPicture.JPG

As far as PDF files are concerned, if you just need to store them so someone can double-click on them to open them up and read them, you can also use this technique, and just launch Adobe Acrobat with the VBA Shell commands to view the file.

Storing the data in your database might not be the BEST solution for your needs if you have a lot of data.

Now, if anyone is interested in learning more about this topic, I would be willing to put together a mini-seminar showing you how to store pictures and other images in this manner - in a folder on your PC/network and launching or viewing them with VBA.

I'll add this as a new Seminar on the WAITING LIST

It's under the NEW SEMINARS section as Viewing External Images in Access Forms/Reports Without OLE. If you'd like to see this seminar, then cast your vote now.

Keywords: access ole linking embedding

<< First   |  < Previous   |  Next >   |  Last >>
I like what you do Comment from Naa Albert @ 12/23/2009
hey rost! its been great using your free tutorials and I give you my personal two thumps up. I am a boy of 22 i live in Ghana and i dont have money to buy any of your complete tutorials but atleat am happy with what the free tutorials has given me. Thank you
printing the pdf Comment from Dave Sterner @ 10/7/2009
They come from a variety of sources: ArcGIS, Google maps, but most are hand drawn on pre-existing watershed maps and then scanned. Ultimately I hope they go to one source, like ArcGIS (which right now get printed as pdf's). I was trying not to rock the boat too much with their previous methodology(non-Access - hand written data forms and hand drawn maps - both of which they were scanning)and was excited, then disappointed when I showed them the linked OLE object function.

For the time being it looks like the choices are 1) work with big access files (each recordw/pdf link = 7 Mb X ~100 records/year)or 2)have them double click on the form's OLE box and then print the data part of the report.
printig the pdf Comment from Richard Rost @ 10/7/2009
Would these happen to be maps you could get off the Web, like from Google Maps? If not, any chance at storing these as image files instead of PDFs? I'm not saying it's not possible, but I've never done it before (with PDFs) so I'd have to experiment.
printig the pdf Comment from Dave Sterner @ 10/7/2009
A complete report is two pages - one page of Access data and one of the pdf. Ideally they would print a report that has the data on one page and the map accompanying it - it would be a different pdf/map each time.
printing the pdf Comment from Richard Rost @ 10/7/2009
You can't interact with objects on a report. They're basically read-only. You can't double-click on a report field, for example, and do stuff with it. Do you have a separate report with Access data that you also need to show, or is it JUST the PDF file that needs to be printed?
printing the pdf Comment from Dave Sterner @ 10/7/2009
Hi Richard: Thanks for the reply. I guess what you are saying is that the best solution for me might be to write some script that prints the pdf without storing in access, but is there a double-click solution for the Ole bound box in a report. On the database that I sent you, on page 2 of the R_Exemptions report file I inserted a bound OLE to print the pdf file. But in the report, I can't double-click on it like I can the bound OLE in the form and get the pdf to open. Of course, for my users, the ideal would be for them so somehow seemlessly print each report without having to do anything special with the pdf. The next best thing would be to be able to double click or some such on the report Ole bound box and print the pdf.

 

Add Your Comments:
  Your Name:  Shown
  Your Email:  NOT Shown
  Subject:
  Comments:

 
  Notify me when Rick's Blog is updated
  Remember Me for my next comments
 
 
Are you a human?
Type in the word you see to the left:

   
  Please do not use this form for Customer Service inquiries! If you have questions about your account, shipping info, courses you've ordered, need passwords, etc. please use the Customer Service Center instead.

I value your comments. They will be displayed on this page (above). Your name will be displayed, but your email address will not be. I just ask for your email address so I can contact you back, if necessary. As always, I promise to never give away your email address.

 

<< First   |  < Previous   |  Next >   |  Last >>
  Richard's 599CD Blog      home   history   comments   notify me   admin  

599CD on Facebook  599CD on Twitter  Subscribe to RSS Feed  Add to Live Bookmarks  Add to My AOL  Add to MyYahoo  Add to Google Reader or Homepage    hide help

 

Huge Discounts Available
When you purchase multiple classes together
Huge savings up to 50% off! Order Now.

 

Need Help
 
Do you have questions about Word, Excel, Access, Web Design, or computers in general? Just ask us anything you'd like. Click here for assistance.
 

Get Free Tips & Tricks
 

Join our mailing list today and get information on our Free Tips & Tricks Newsletter including free video tutorials, eBooks, live seminars, and more.

Email:
Name:
Type in the word to the left:
 
Your email will be kept 100% safe and will never be given to 3rd parties.
 


CLICK HERE for a FREE lesson



Order your first 599CD course now.
Your Satisfaction is Guaranteed!


Subscribe to our RSS FeedWhat's This?

599CD on Facebook  599CD on Twitter  Subscribe to RSS Feed  Add to Live Bookmarks  Add to My AOL  Add to MyYahoo  Add to Google Reader or Homepage    hide help

599CD Home   |   Learn More   |   What's New?   |   Contact Us   |   Free Demo   |   FAQs   |   Order Now   |   Affiliate Program   |   TechHelp   |   MYOLP   |   Jobs   |   Downloads   |   Handbooks  (Text)   |    Mailing List   |   Lost Passwords   |   Referral Program   |   Online Poll   |   Corporate, Educational, Government, Non-Profit Sales   |   Message Forums   |   Testimonials   |   Privacy Policy   |   Free Gift CDs   |   Tips & Tricks