locked
Access VBA Image Control Path to Azure Storage RRS feed

  • Question

  • I have an Access database containing an image control. The images used by this control have been copied from a local file server to Azure Storage. The Picture property of the image control works with the local path, ie. picture="\\192.168.1.4\myImages\imageName.jpg"

    With the images now stored in Azure Storage I know the Storage Account Name, the Storage Access Keys, the Container Name and the image name. I have tried setting the path to picture="https://my.blob.core.windows.net/myImages/imageName.jpg" but it can not find the image.

    Can anyone help with a simple image path to Azure Storage?

    Tuesday, August 19, 2014 2:12 PM

Answers

  • Hi Gary,

    I can understand your meanings. You could use image like this "https://willimage.blob.core.windows.net/img/1.jpg" . But you need set the container as public permission . If you use SAS to access storage account, you need use blob SAS uri to request the content,like this URI:

    https://myaccount.blob.core.windows.net/pictures/profile.jpg?sv=2013-08-15&st=2013-08-14&se=2013-08-15&sr=c&sp=r&rscd=file;%20attachment&rsct=binary &sig=YWJjZGVmZw%3d%3d&sig=a39 %2BYozJhGp6miujGymjRpN8tsrQfLo9Z3i8IRyIpnQ%3d

    You could refer to this document http://msdn.microsoft.com/en-us/library/azure/dn140256.aspx and Gaurav's post(http://stackoverflow.com/a/17572316 ).

    Regards,

    Will


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, August 27, 2014 3:12 AM

All replies

  • Hello Gary Samuels,

    Thank you for posting on this forum. Without understanding your actual code for connecting to the Blob storage, it would be difficult to give you the exact answer.
    However, please be informed that the security is a major factor when giving read/write permissions from the Access VBA to the blob storage. I see that one of the user was able to accomplish this by creating custom dlls using VB.Net.
    Please refer to the response from 'Voyagr12' dated on 'Friday, January 13, 2012 11:41 PM' from the post below:

    http://social.msdn.microsoft.com/Forums/en-US/87cd0be0-ce3b-4eb4-af3f-33b885029749/microsoft-access-and-photos-stored-in-azure-blob-storage?forum=windowsazuredata

    Thanks,
    Syed Irfan Hussain

    Tuesday, August 19, 2014 3:01 PM
  • Hi Gary,

    I can understand your meanings. You could use image like this "https://willimage.blob.core.windows.net/img/1.jpg" . But you need set the container as public permission . If you use SAS to access storage account, you need use blob SAS uri to request the content,like this URI:

    https://myaccount.blob.core.windows.net/pictures/profile.jpg?sv=2013-08-15&st=2013-08-14&se=2013-08-15&sr=c&sp=r&rscd=file;%20attachment&rsct=binary &sig=YWJjZGVmZw%3d%3d&sig=a39 %2BYozJhGp6miujGymjRpN8tsrQfLo9Z3i8IRyIpnQ%3d

    You could refer to this document http://msdn.microsoft.com/en-us/library/azure/dn140256.aspx and Gaurav's post(http://stackoverflow.com/a/17572316 ).

    Regards,

    Will


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, August 27, 2014 3:12 AM
  • Hi Will,

    It took a while but I have it working. Your first suggestion pointed me in the right direction.

     "https://willimage.blob.core.windows.net/img/1.jpg"

    Following your example I was able to place the ULR into a browser and it would display or download the file. That proved to me that my problem was not downloading the image, it was getting the image to display in the access form. I learned I need to replace the Image Control with an ActiveX Internet Browser Control. Finally the images started showing up but I couldn't control the size of the image. To cut the story short I created a web page and when I call it I added the image name as a query string. Now instead of calling the image directly like the example I'm calling a web page that displayed the image and in the page I can set the size of the image to display as needed.

    On to the next step, learning how to upload an image to the Azure Storage container using VBA.

    Wednesday, September 17, 2014 9:30 PM