none
trying to STORE pix with accdb file. so these pix go with file. Even if moved to a different machine. RRS feed

  • Question

  • I have used tables holding the path to a pix I wanted to use on a control.

    I have "EMBEDED" a pix on a control using property sheet of control.

    Problem is ALL the times I have done ANY of those things. 

    It seems I am ONLY saving a PATH to where pix is on current machine. Not sure of that.

    That is a problem if the file is moved to a different machine.  because the path would be no longer valid.

    do I use a attachment field in a table some how.   I am NOT sure if I am saving the path OR a COPY of the pix like I want to.

    any info will help.

    Mark J


    Mark J

    Monday, August 29, 2016 11:40 AM

All replies

  • In my experience, an embedded image stays with the database without needing to bring the file along. I've even lost the file with no bad effects.

    What kind of control are you using? Is it a standard Access control or an ActiveX control?


    Bill Mosca
    www.thatlldoit.com
    http://tech.groups.yahoo.com/group/MS_Access_Professionals

    Monday, August 29, 2016 3:41 PM
  • >>>do I use a attachment field in a table some how.

    Accrording to your description, you could use a attachment field in a table. Attachments also store data more efficiently. Earlier versions of Access used a technology called Object Linking and Embedding (OLE) to store images and documents. By default, OLE created a bitmap equivalent of the image or document. Those bitmap files could become quite large — as much as 10 times larger than the original file. When you viewed an image or a document from your database, OLE showed you the bitmap image, not the original file. By using attachments, you open documents and other non-image files in their parent programs, so from within Access, you can search and edit those files.

    In addition, OLE requires programs called OLE servers to function. For example, if you store JPEG image files in an Access database, every computer that runs that database requires another program that is registered as an OLE server for JPEG images. In contrast, Office Access 2007 and later stores the attached files in their native formats with no supporting images, and you do not need to install additional software in order to view the images from within your database.

    >>>I am NOT sure if I am saving the path OR a COPY of the pix like I want to.

    You could refer to Work With Attachments In DAO

    Thanks for your understanding.

    • Proposed as answer by David_JunFeng Friday, September 2, 2016 8:28 AM
    Tuesday, August 30, 2016 3:23 AM
  • Bill Mosca,

    In this database I am only using standard Access controls.

    In some of my OLD notes about an "embedded image" for an access control.

    1. if I embed a image, the image is stored with the object.

    2. to embed a image I need to select from "available images" my notes did NOT indicate how to add an image to the "list of available images".  Which I will need to learn how to add a image to the list of available images if I am going to use "embed image".

    Thanks for the info.

    Mark J


    Mark J

    Friday, September 2, 2016 6:47 AM
  • David_JunFeng,

    The info about OLE is very helpful.

    Especially about Access 2007 and later.      And the link about DAO.

    Looks very similar to other things I have done in DAO. So seems this will work great for me.

    I will have to see if I can make it work for me.

    I will get back to this forum, if I can make it work for me, or I need more questions to make it work.

    Mark J


    Mark J

    Friday, September 2, 2016 6:57 AM
  • David_JunFeng,

    the link was very helpful with adding to an Attachment field.

    Referenced "LoadFromFile" I couldn't find more than a snippet of code using it so not sure what else I need to make code work?

    I did by hand add pix to the attachment field in the table.

    I did find some text along the lines to use field,

    1. Drag the entire attachment field from the list to your form — the parent and child items — and drop it in the location that you want on your form.

    BUT what I need to do is assign the attachment pix to controls like the form as a background image, and another image most likely a bitmap to use on a command button.

    I cannot seem to find a way if possible to use what is stored in the "paper clip" ( attachment field and attachment control ) for anything else. which was the only reason to use the attachment field in the table in the first place.

    I would be using a query to get one record of a table, that was holding the "pictures"

    any help or answers I can get will help.  I am hoping I don't get the answer you can only display a value in an attachment field in a attachment control.  But even hearing that, is better than wasting time trying to make something work when there is no way it can work.

    Mark J.


    Mark J

    Friday, September 2, 2016 2:14 PM
  • >>>BUT what I need to do is assign the attachment pix to controls like the form as a background image, and another image most likely a bitmap to use on a command button.

    According to your description, unfortunately, it is impossible to assign the attachment pix to controls like the form as a background image, and another image most likely a bitmap to use on a command button.

    So I suggest that you could submit any feedback to Access UserVoice:

    https://access.uservoice.com/

    Thanks for your understanding.

    Thursday, September 8, 2016 8:52 AM