Results 1 to 5 of 5
  1. #1
    Join Date
    Dec 2005
    Posts
    3

    Unanswered: Images from web in a Access form?

    I would like to load images from a web resource into access somehow.

    The image could be like:
    http://www.test.com/1234.jpg

    But the prefered url would really be like this:
    http://www.test.com/showimage.php?1234

    I read somewhere that access har problems if the url doesn't end with JPG, but I guess I could use mod_rewrite on apache to make a fake url somehow.

    The reason I need this is that I have another application, based on php/mysql which needs to access the same images.
    I hope anyone can help me, this is a really hard question to google!

    -nicmar, first post

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    if you have a PHP script to display an image then
    http://www.test.com/showimage.php?1234
    should probably read
    http://www.test.com/showimage.php?<myparam>=1234
    where
    <myparam> is the name of the parameter in the script that you will assign the image to.

    If you are going down that route then its quite feasible not to require the image extension (you could tet for a jpg / JPEG / gif / png etc
    however you are doing some more work. the gdlib provides some methods to do this)

    if you just want to pull the specified image in then
    http://www.test.com/1234.jpg should pull in that resource
    Within Access however you don't need a script to handle the image. Just cite the url to the resource and assign it to an image control

    eg
    <myimagecontrol>.image=[mycolumn]
    imgExternalURL.image="http://www.test.com/images/1234.jpg"

    assuming of course that your image is stored in a subdirectory of the webserver called images

  3. #3
    Join Date
    Dec 2005
    Posts
    3
    Interesting! I will try this, by the way the access in use is Access runtime 2000, would that be of any problems?

    Thanks!

  4. #4
    Join Date
    Dec 2005
    Posts
    3
    eg
    <myimagecontrol>.image=[mycolumn]
    imgExternalURL.image="http://www.test.com/images/1234.jpg"
    Hmm.. i'm trying this here in my Access, but I'm not sure how or where to type this.. What is [mycolumn] and do I need both lines of code?

    An image control, is that just a simple image-thing that you insert into the form? I'm not very good at access really and I'm trying to figure this out for another developer..

    I also tried to put the url to the image in the first tab of the image settings, where it's usually C:\blabla.jpg but it says it can't read the file..

    Hope you can give me some more guidelines

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    imgExternalURL.image="http://www.test.com/images/1234.jpg"
    where:-
    imgExternalURL is the name of your image control in your access form
    "http://www.test.com/images/1234.jpg" is the name of your resource

    alternatively
    <myimagecontrol>.image=[mycolumn]
    <myimagecontrol> is the name of your image control in your access form
    [mycolumn] is the name of column (field) in your data.

    you may prefer to do a load image only when required, rather than every time.
    if you choose not to use a bound image control then place your code in the forms on current event and the text box that contains the URL's on change/on lost focus events. OR consoder placing a button to load an image on demand.

    if you are using runtime then you will need to be a bit more savvy about error handling and trapping

    something very similar was asked here
    Last edited by healdem; 12-16-05 at 07:04.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •