How to keep pics somewhere else?

They say its better not to put images to database. Maybe its rumors, maybe not. Anyway, large amount of images makes DB fat and thus stresses database application. Its not easy to handle fat beings, huh.

Thanks to AccessImagine, all you need to specify is where to keep images – and it will do all the job by itself. If you try to code external storage by your own, you will have hard times. Not worth getting in trouble with.

There is StoragePath property accessible at the design-time. After specifying it  AccessImagine will store images there while image filenames will be written to the bound database field.

Here is an example of the StoragePath property values:

  • D:\MyWork\Images
  • \\Avenger\Incoming\Pics” – local network path, useful for centralized storage
  • Pics” – subfolder in folder, where your database file is stored
  • .” – keep images in the same folder with database file

AccessImagine tries to preserve original name of the picture – or gives some common name (like “image”, “scan”, “paste”) if it originated from the other source. Surely, component adds some numbers for duplicate filenames.

Notice: if a file is no longer needed (i. e. user put a new photo instead the old one) it will be deleted from the storage.

4 Responses to “How to keep pics somewhere else?”

  1. ipodrus says:

    I have a db that I store all the locations of my images. I want to load the control with a image. Can I do that in code? If so what is the format. I tried .value but it did not work

  2. Max D says:

    You can use LoadFile method like this:

    Pic.LoadFile “c:\pics\house.jpg”

  3. joseph buppe says:

    I would like to store images externally, but I cannot see the property inspector to do this.

    • Max D says:

      In order to show property inspector you need to press right mouse button on some object and select “Properties” in menu.

Leave a Reply

Comment Spam Protection by WP-SpamFree