Page 1 of 1

[Solved] Best Approach for Images - Store or Link?

Posted: Tue Aug 24, 2010 10:20 pm
by Steve R.
Last night I figured out how to store an image into BASE. The images are of magazine covers. The covers change as your form goes from one issue to the next. In MS Access the recommend approach is to LINK to the image so that it is NOT stored in the database itself. Storing pictures in MS Access causes extensive database bloat.

I am very slowly converting my MS Access database to BASE. My question, in BASE, which is the recommended approach for storing images. Within the database itself or through a link to an external image file?

Re: Best Approach for Images - Store or Link?

Posted: Tue Aug 24, 2010 10:46 pm
by Villeroy
Link the images and bind a form's picture control to a text field containing the relative file-URLs.
Easiest way:
Avoid all special chars and spaces in picture file names.
(Linux shell)$ ls -1 *.png > pics.txt [drops all png files in this directory as a single column in file pics.txt]
Link the text file to a text table: [Tutorial] Using csv/text files as editable data source. which should work with most database engines, including HSQL.
Put the odb-database in the same directory as the pics.txt and the pictures, so you don't need any path.
Link the file names to some other tables. Use relations and edit them through list boxes so you can associate the file names with other data.
Create the form(s)
Another ls -1 *.png>pics.txt updates the list of pictures.

Re: Best Approach for Images - Store or Link?

Posted: Wed Aug 25, 2010 1:56 am
by Steve R.
Thanks. The guidance should prove useful. Importing the data from MS Access wasn't too bad, but its going to be slow getting it running under BASE. Good learning experience.
A post on my project is located here: Analog Science Fiction And Fact Database

Re: Best Approach for Images - Store or Link?

Posted: Wed Aug 25, 2010 7:23 pm
by Villeroy
Before someone asks for it, here is another example db with a data flow
Shell command listing file names to >pics.txt >linked HSQL-table named "pics" >one-to-many relation to "Table1" >bound column of the form's picture control
[plus an additional index which prevents using the same picture twice]

All the details are documented in the form

Re: Best Approach for Images - Store or Link?

Posted: Thu Nov 04, 2010 4:33 am
by Steve R.
Yea!! :D Finally got around to experimenting with this. Developed a test database and followed the directions. It worked.
It will still be challenge incorporating it into my "real" database, but a least I know that linking to images is workable.
Thanks very much for the help.

Re: [Solved] Best Approach for Images - Store or Link?

Posted: Thu Nov 04, 2010 10:13 pm
by Villeroy
Thank you very much for this late feedback. I'm glad that you found your way through the jungle.