Solved Database where possible collect several images for each record (1 Viewer)

georg0307

Registered User.
Local time
Today, 11:51
Joined
Sep 11, 2014
Messages
91
Dear all,

what is the best way to create a database where in a field I can collect several images?

Is it possible then send an email from record where these images are automatically attached?

Thanks in advance,

Best regards,

Georg
 

Isaac

Lifelong Learner
Local time
Today, 03:51
Joined
Mar 14, 2017
Messages
8,738
if any significant volume i suggest store paths to images on network, not db attachments themselves
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:51
Joined
Feb 28, 2001
Messages
26,996
Georg - first, be careful about storing images in a database. There is a difference between controlling image storage and actually storing the images. The problem is that images tend to take up a LOT of space. Your database can get terribly big with images and become unweildy.

What I did was I had forms with image controls where all you needed to do was store the file name in the control and it would then display them. But I kept a folder set aside where I would move the image files - in my case, in a child folder of the one where the BackEnd file was kept. Using the file system object, it is trivial to move a file to a targeted folder.

Yes, once you have the image, it is possible to send an e-mail with the separate file as an attachment. In fact, it might even be easier doing it that way than to store the image inside the DB. Outlook allows this quite reasonably. Note that it looks a bit awkward, but many code examples exist in this forum for managing e-mail attachments.
 

georg0307

Registered User.
Local time
Today, 11:51
Joined
Sep 11, 2014
Messages
91
Georg - first, be careful about storing images in a database. There is a difference between controlling image storage and actually storing the images. The problem is that images tend to take up a LOT of space. Your database can get terribly big with images and become unweildy.

What I did was I had forms with image controls where all you needed to do was store the file name in the control and it would then display them. But I kept a folder set aside where I would move the image files - in my case, in a child folder of the one where the BackEnd file was kept. Using the file system object, it is trivial to move a file to a targeted folder.

Yes, once you have the image, it is possible to send an e-mail with the separate file as an attachment. In fact, it might even be easier doing it that way than to store the image inside the DB. Outlook allows this quite reasonably. Note that it looks a bit awkward, but many code examples exist in this forum for managing e-mail attachments.
Thanks Doc,

sincerely I don't have an idea how to do it. Is it possible have a basic sample.

I understand that I have to create a field that contains links to images place in a folder, it seems ok, but how?

Thanks in advance

Best regards

Georg B.
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 05:51
Joined
Feb 28, 2001
Messages
26,996
Actually, I don't have a sample myself because I don't own the most recent case where I did that. Once I retired, I was forced to surrender all copies, since it was a U.S. Federal database.

As to image controls and the links..... you don't even need "links" in the formal sense. If you move your images to a common folder, you have to generate a fully qualified file spec including the path (location) of the file if you are using the FileSystemObject .MoveFile option. So... store that fully qualified file spec (FQFS) as a text field in the DB. Then on the form when you have an image control, you can store that FQFS in the image control's .Picture property.


Here is a link for an Excel VBA solution to sending e-mail with attachments. In the #1 solution to the forum question, there is a line having to do with .Attachments.Add that is adding an external file. There is where you would use that FQFS.

 

MajP

You've got your good things, and you've got mine.
Local time
Today, 06:51
Joined
May 21, 2018
Messages
8,463
Did a recent demo in this thread and discussed how you can do this without the function.
1. Make table settings where you can change the path or use a folder inside the same location as the db
3. Name the images with the same name stored in the table. In your case you would have a table of images linked to the parent table. Store the name of the image in the table
4. use a bound image control. Concatenate the path and image name. If this is complete no code is required for the image to render.

In the attached I used a function that makes this a little easier, but not as efficient in a continous form.
 

Users who are viewing this thread

Top Bottom