View Full Version : Access Question - retrieving image from URL
grimpixie
04-13-2010, 01:54 AM
Greetings all
I have a database which has a URL stored in a text field which points to a JPG image - is there any way to retrieve this image from the URL and have it display in a report/form?
Thanks in advance
Grim
Dahnlor
04-13-2010, 08:56 AM
Unless the image is blocked in some way, you should be able to copy the URL into a browser and open the image, then simply copy and paste it to your report.
friedo
04-13-2010, 09:00 AM
Unless the image is blocked in some way, you should be able to copy the URL into a browser and open the image, then simply copy and paste it to your report.
That sort of defeats the purpose of having an automated report, doesn't it?
Clothahump
04-13-2010, 10:36 AM
Put a picture box on the form, then set the source to the URL.
psychonaut
04-13-2010, 10:47 AM
nevermind; failed to read the title
Khendrask
04-13-2010, 11:14 AM
Put a picture box on the form, then set the source to the URL.
That should work, but only if you (and other users) can successfully resolve the URL, meaning it has to be on a share that everyone can read, or on an anonymously accessible web site.
grimpixie
04-13-2010, 01:29 PM
Put a picture box on the form, then set the source to the URL.The URL is different for each record in the database, how would I get it to update itself on each page of the report?
That should work, but only if you (and other users) can successfully resolve the URL, meaning it has to be on a share that everyone can read, or on an anonymously accessible web site.That's not a problem, the images would be on our organisation website.
The URL is different for each record in the database, how would I get it to update itself on each page of the report?
That's not a problem, the images would be on our organisation website.
Ugh. Is the URL already in the table or query you're using as a source? Because then you'll probably want to do this programatically. The appropriate article in the Microsoft's Office Help database (http://office.microsoft.com/en-us/access/HA011472041033.aspx#ConfigureTable) told me the following will work in Access 2002 or later:
http://support.microsoft.com/default.aspx?scid=kb;en-us;285820
It seems silly to me that there's not a built in Picture control that will automatically take it's file location data from a field.
grimpixie
04-15-2010, 05:26 AM
I found that article and was in the middle of trying to copy the code across and adapt it when I realised that we had all the appropriate images stored on our server and I'd be able to use other data they'd entered to create a file path in my query. This then proved surprisingly easy to use to change the Picture's Control Source property when the Report Loads - problem solved!!
Lateral thinking saves the day!!
Thanks for the help everyone.
Grim
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.