Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Database Design

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 06-18-2009, 02:16 PM
Nosaj08 Nosaj08 is offline Windows XP Access 2002 (version 10.0)
Advanced Beginner
 
Join Date: Apr 2009
Posts: 40
Nosaj08 is on a distinguished road
Question Linked OLE Objects bloating size of database

Hello everyone,
I am running into a slight problem with my database design. Currently, I am constructing a database that acts as an inventory system. For the inventory table, I have one column with its data type set as an OLE Object for the purpose of adding an image of each product into the table. To insert the image, I have a form linking to the table with an OLE Object box and its property is set to only allow linked images. Now my question is, why would that column be adding 230 mb to my database size if all of the images are linked and not embedded? There are only about 85 entries into the table. Also, I have tried compacting and repairing and that has not been able to fix the problem. Any ideas? Thanks in advance!

Jason
Reply With Quote
  #2  
Old 06-18-2009, 04:28 PM
marianne marianne is offline Windows XP Access 2003 (version 11.0)
Competent Performer
 
Join Date: Mar 2009
Location: Asia Pacific Region
Posts: 151
marianne is on a distinguished road
Default

well. often it is recommended not to any images on the database itself BUT save ONLY the path of the images in the database and allow the code to get the path and show it in a form or report.
Reply With Quote
  #3  
Old 06-18-2009, 05:40 PM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,263
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Marianne is absolutely correct. Access is terribly inefficient at storing pictures. There is improvement in ac2007 with the attachment field but then you are limited to ac2007. Just store the path to the picture and display them as needed. Here's a link to three ways to do that.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #4  
Old 06-19-2009, 02:59 PM
Nosaj08 Nosaj08 is offline Windows XP Access 2002 (version 10.0)
Advanced Beginner
 
Join Date: Apr 2009
Posts: 40
Nosaj08 is on a distinguished road
Default

Ok, sounds good. Ill browse through the example to see what I can pull out of it. Thanks for the help!

Jason
Reply With Quote
  #5  
Old 06-23-2009, 07:26 AM
Nosaj08 Nosaj08 is offline Windows XP Access 2002 (version 10.0)
Advanced Beginner
 
Join Date: Apr 2009
Posts: 40
Nosaj08 is on a distinguished road
Default

Hey RuralGuy,
Thanks for the link! Linking the image as an external file worked perfectly for what I needed to do. I ended up modifying the code slightly to allow me to add the image directly into my form, without having to double click on the value and open a second preview window. However, one problem that I am having with it is when there is no image linked to a particular inventory item and there is no value in my "Display Image Link" field, I receive an error that says "Type Mismatch". Is there an If-Then statement that will allow me to tell the image box that if there is no data in the image link field to stay blank or become disabled? Right now my image box refers to the image link text box using the following VB code:

Me![imgTheImage].Picture = [Display Image Link]

Thanks for all the help!
Jason
Reply With Quote
  #6  
Old 06-23-2009, 07:45 AM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,263
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

How about creating an image for "No Image Available"? You of course could stop the load if you want with VBA. Are you loading the picture in the Current event of the form?
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #7  
Old 06-23-2009, 08:00 AM
Nosaj08 Nosaj08 is offline Windows XP Access 2002 (version 10.0)
Advanced Beginner
 
Join Date: Apr 2009
Posts: 40
Nosaj08 is on a distinguished road
Default

I am loading the picture in the On Open event and also on each of the navigation buttons on the form so it would update the image when I changed to another inventory item. I think I would rather stop the load through VBA just in case someone forgets to attach an image to the inventory item. I also have inventory reports that I use this same method on and if one item does not have and image attached to it, I'll receive the "Type Mismatch" error upon opening the report followed by access closing the report. Should I change over to On Current instead?
Reply With Quote
  #8  
Old 06-23-2009, 08:24 AM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,263
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Use the Current event of the form. That event will fire every time you land on a new record, including the first time after the form is opened. Then change the code to:
Code:
If Len([Display Image Link] & "") > 0 Then
   Me![imgTheImage].Picture = [Display Image Link]
Else
   Me![imgTheImage].Picture = ""
End If
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #9  
Old 06-23-2009, 04:01 PM
Nosaj08 Nosaj08 is offline Windows XP Access 2002 (version 10.0)
Advanced Beginner
 
Join Date: Apr 2009
Posts: 40
Nosaj08 is on a distinguished road
Default

Ok, I made the change and it worked perfectly on the forms, Thanks! Any idea why the Else command wouldn't work on a report? I tried using the code in the On Open event for the report and it did not place any of the images correctly. So, I moved the code over to the On Format event under the Detail section and that seemed to allow all of the images to display correctly. However, once it gets to an item with no image, Access uses the image from the previous item instead of making it blank. This problem only occurs in reports.
Reply With Quote
  #10  
Old 06-23-2009, 05:12 PM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,263
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Try using the DetailPrint event instead of the DetailFormat event. The events in a Report are nothing like the events in a form.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #11  
Old 06-23-2009, 05:16 PM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,263
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Actually I think you will need to play with the Visible property of the control displaying the picture. Something like:
Code:
If Len([Display Image Link] & "") > 0 Then
   Me![imgTheImage].Visible = True
   Me![imgTheImage].Picture = [Display Image Link]
Else
   Me![imgTheImage].Visible = False
End If
...using your control names of course.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #12  
Old 06-24-2009, 03:35 PM
Nosaj08 Nosaj08 is offline Windows XP Access 2002 (version 10.0)
Advanced Beginner
 
Join Date: Apr 2009
Posts: 40
Nosaj08 is on a distinguished road
Default

Yup, that seemed to do the trick. Its strange that the code needs to be written differently in reports than in forms in order to perform the same function. I guess I need to learn more about the structure of the VB language to understand it. Thanks for all the help!

Jason
Reply With Quote
  #13  
Old 06-24-2009, 05:18 PM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,263
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Quote:
Originally Posted by Nosaj08 View Post
Yup, that seemed to do the trick. Its strange that the code needs to be written differently in reports than in forms in order to perform the same function. I guess I need to learn more about the structure of the VB language to understand it. Thanks for all the help!

Jason
Hi Jason,
Actually the two are very different and serve completely different functions. Reports are a one way piece of paper headed for a printer and Forms are objects for a screen where the user interacts with the object. Really very different. There are also things you can do with a report that are a real bear to do in a form such as running totals. Different tools for different jobs.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #14  
Old 07-03-2009, 01:03 PM
Max D's Avatar
Max D Max D is offline Windows XP Access 2007 (version 12.0)
Advanced Beginner
 
Join Date: Jul 2009
Posts: 41
Max D is on a distinguished road
Default

Its hard to write external image storage usually. You'll find some problems again and again.

Beside that, its usually not easy for users to manipulate images in such a database. There is a ActiveX control called AccessImagine, which handles external image storage automatically and makes adding images to database convenient - you can load from file, scan, paste from buffer or drag-n-drop. You can crop image right inside the database and do much hard-for-Access tasks with it.
Reply With Quote
  #15  
Old 07-03-2009, 02:26 PM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,263
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Max,
That really looks like a good image tool and only $28. Thanks for the link.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
All Access Objects shows nothing Viwadd Access 5 05-29-2009 12:23 PM
IMPORT-ALL-OBJECTS is missing Tool pacala_ba Import/Export Data 0 03-25-2009 08:13 AM
Access Database size Grows too fast no-e Access 0 12-16-2008 11:29 AM
ACCESS File size doesnt change after deleting objects GeorgeILPS Access 2 01-14-2008 09:15 AM
No data in database that shows file size being almost 2mb?? valkyry Access 2 07-24-2006 07:19 PM


All times are GMT -8. The time now is 02:43 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.