Topic: [Report] Display an image in a report when using the LinkFile

Display an image in a report when using the LinkFile (mode of component DBImage)
When the image file is not stored in the database, stored on a computer disk.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

Dmitry.

Re: [Report] Display an image in a report when using the LinkFile

can you explain to me me the advantages and disadvantages of using the link file?

Re: [Report] Display an image in a report when using the LinkFile

Hello montenegro

This question about how to store images in a database has already been addressed in the forum of MVD.

Here is what was my opinion upon this item :


When creating a database, it is not advisable to store images (or anything else) in the same base (weight too heavy, difficult and time manipulation).
Here is the goal of property CopyTo.

Let's take an example :

You want create an application to manage yours books. You want to display the book cover.
In this purpose, you place a DBImage component.

2 options :

1 - You store pictures inside your database. Bad choice. Forget it :
2 - You want store pictures in folders apart. Good option.

DBImage component has two properties to use :

- StoreFile (for the bad solution)
- LinkFile : Choose this option to say MVD to store pictures not inside database but in a folder apart.

The other property is CopyTo. Here you get name of the folder storing pictures (i.e. \Covers).
Then all pictures will be saved in this folder which lighten the weight of the base.

You can even narrow down your choice of records.
Let's say in our example of management books you want to create a folder by author and not a catchall folder
(i.e : \COBEN, \RANKIN,\KING and so  on...).

If the form you enter yours books has a combobox for the name of the auteur, you can add

in event OnAfterClick of your button Save this instruction

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
       Form1.DBImage1.dbCopyTo := '\Covers\' + Form1.ComboBox1.Text ;     // We create a subfolder in the folder  Covers
end;

it works perfectly, I did it for my own management of my books.

It is these small features that make a great MVD database management software.

Of course, one can challenge this opinion. I do not pretend to be right.
TCoton was not quite agree with me, his opinion was also admissible.

In fact, how you want to create your application will make the difference

JB