The Path in the module

hfsitumo2001

Member
Local time
Today, 00:55
Joined
Jan 17, 2021
Messages
394
When I develop the iventory database, the path is : C\folderA\Pictures. An d in my database field there is attachment type of pictures. The picture of in the form comes from the folder with the above path. Now when I moved the backend to the server, the path will be: \\serverA\foderA\pictures. I copy from my C drive to the server for pictures. While the table I follow the procedure of splitting the tables.
My question is will the pictures still work/show in the form/report even though I just copy the pictures manually to the server?. I know for the database should work, because I followed the procedures of splitting the database.

Thank you for any enlightens
Frank
 
the Attachment is saved in the Db, not on any drive or folder.
 
The answer is, if the path to the pictures is correct, it should work. Here is your test (and the reason WHY it should work.)

See if, from Windows (File) Explorer on your FE machine, that you can find/see the file with that URS. Abd that you can open it. If so, then you are OK because Access uses the Windows File system to get from point A to point B as well. That is, if Windows can see it, you can see it.

For what it is worth, if your code "develops" the path leading to the right folder, it will be able to find them. Because it doesn't matter HOW the pictures got there. It matters that they ARE there.

BUT there is one exceptional issue here. If these pictures are going to be visible to a lot of people, be sure that you watch out for the file permissions that you use when writing the files. It is possible that if you wrote the files with your own ID as owner, that others (who aren't you) won't be able to use them fully. Since I don't know exactly how you want to write the files or what you want to do with them later, I can't advise you on specifics.
 
Frank
You are using an attachment field. As @arnelgp stated, copies of each file are stored within your database. So it doesn't matter where the original is moved to, as you are using a copy.
However, doing this significantly increases the size of your database and at some point you will likely hit the 2GB Access file size limit. It is therefore not a recommended approach.

Instead a much better approach is to use a text field that stores the file path whether it is on your local hard drive or on the server. This does not store a copy in the database so Access file size remains small.

To manage handling moving all the files to a new location easily, I normally store all the picture file names in one table and the image file location in a separate table. This means the location only needs to be updated once. The full image path is obtained by concatenation the location and file name

Hope that all makes sense
 
the Attachment is saved in the Db, not on any drive or folder.
but all pictures I saved in a picture folder, then when I open the form, in the frame attachment I was guided to take it from which folder then I take from Picture folder, then I clicked and shown up on the form. That is the way I put it in the form. Am I right?
 
Frank
You are using an attachment field. As @arnelgp stated, copies of each file are stored within your database. So it doesn't matter where the original is moved to, as you are using a copy.
However, doing this significantly increases the size of your database and at some point you will likely hit the 2GB Access file size limit. It is therefore not a recommended approach.

Instead a much better approach is to use a text field that stores the file path whether it is on your local hard drive or on the server. This does not store a copy in the database so Access file size remains small.

To manage handling moving all the files to a new location easily, I normally store all the picture file names in one table and the image file location in a separate table. This means the location only needs to be updated once. The full image path is obtained by concatenation the location and file name

Hope that all makes sense
Do you have the small sample Colin?, coz like I said, if I watched on youtube they used attachment field in their presentation. We just have not more than 100 items, so I think it will take long to overpass the quota.

Thank you.

Frank
 
See discussion on how to do this. Easiest is to save in a folder. Save the NAME only. Save the default folder in its own table. Use the bound image control.

If you want to use an attachment field and save in the database then probably 100 images is not a problem. There is no code involved in doing that either.

Prior to 2007 saving images in the database drastically increased the size of your database. That is no longer true. It only increases the database about the size of the images. So 100 jpeg images at .5 meg is about 100 * .5meg. In the old days images were stored in OLE field. They had to be BMP which tend to be very large and they were stored with metadata to allow the default application to render them. So it took much more than 1meg to store. If I remember it was like 2.5 to 3 times. Also the database limit was much less. So quite quickly your datbase was at its limit with just a few embedded BMPs. If you know the total amount of likely images and their sizes you can predict if an attachment field is a viable choice.
 
Last edited:
See discussion on how to do this. Easiest is to save in a folder. Save the NAME only. Save the default folder in its own table. Use the bound image control.

If you want to use an attachment field and save in the database then probably 100 images is not a problem. There is no code involved in doing that either.

Prior to 2007 saving images in the database drastically increased the size of your database. That is no longer true. It only increases the database about the size of the images. So 100 jpeg images at .5 meg is about 100 * .5meg. In the old days images were stored in OLE field. They had to be BMP which tend to be very large and they were stored with metadata to allow the default application to render them. So it took much more than 1meg to store. If I remember it was like 2.5 to 3 times. Also the database limit was much less. So quite quickly your datbase was at its limit with just a few embedded BMPs. If you know the total amount of likely images and their sizes you can predict if an attachment field is a viable choice.
MajP, the total size of my pictures now, when I see on the property of the picture folder it is 53. MB. Would it be a problem?

Thank you
 
No problem, you have up to 2GB for an Access db. If this is about all it will ever be then no problem. The problem is when the boss asks you to add a few hundred more images and like the super high definition ones. The sample database I showed is flexible in that you can have as many images as you would ever want in a folder. It is also pretty portable in that you just pick the folder location. If I remember correctly not all image formats in an attachment field will display. Only certain formats. (I may be wrong). The bound image control I believe renders more. Both are pretty easy to develop to. If you have the attachments already working then no need to change unless you think you will be adding a lot more in the future.
 
No problem, you have up to 2GB for an Access db. If this is about all it will ever be then no problem. The problem is when the boss asks you to add a few hundred more images and like the super high definition ones. The sample database I showed is flexible in that you can have as many images as you would ever want in a folder. It is also pretty portable in that you just pick the folder location. If I remember correctly not all image formats in an attachment field will display. Only certain formats. (I may be wrong). The bound image control I believe renders more. Both are pretty easy to develop to. If you have the attachments already working then no need to change unless you think you will be adding a lot more in the future.
Where did you show it MajP, may I have a look?
 
Do you have the small sample Colin?, coz like I said, if I watched on youtube they used attachment field in their presentation. We just have not more than 100 items, so I think it will take long to overpass the quota.

Thank you.

Frank
Also, in these discussions I always like to remind users that attachments may be an OK approach if you do the maths and it works out. Like you said - only 100 items. Or, you can calculate avg # of new records or new attachments per week.

You can also restrict attachments by filesize - and, I would suggest, filetype, like require PNG. That will give you a lot of attachments before getting to 2GB. For some reason in my cases the whole pictures-issue has typically been taking screenshots for regulatory reasons. (Which I've typically automated using Paint), and the filesizes come out to be tiny, really - 100KB avg. That gives you 20,000 attachments. In one of my databases for Medicare applications and processing, 20,000 attachments would have covered 2-3 years of usage.

I do prefer to store pics on the network and refer to path as others say. But now recently I'm in situations where we have too many global users - not on our same network - and I find myself working (unwantingly) with things like Attachments MVFs, Sharepoint, etc. So I now have this other viewpoint as well, since sometimes you get yourself in a situation where the ideal approach isn't allowed and you have no choice.

I'm now doing a lot of Access FE/Sharepoint BE tools. It's not that fun sometimes, but I'm glad it's still at least possible.
 
Where did you show it MajP, may I have a look?
The link I posted was the example to use the image name and folder path and the bound image control. I did not demo attachments
 

Attachments

The link I posted was the example to use the image name and folder path and the bound image control. I did not demo attachments
Ok MajP, so there is special form to set the path to the picture folder. But when we are in the form, let say on the new picture, how can we put it to the table, if possible, can it auto guide us to choose the picture?
 
Do you have the small sample Colin?, coz like I said, if I watched on youtube they used attachment field in their presentation. We just have not more than 100 items, so I think it will take long to overpass the quota.

Thank you.

Frank

Even if you only ever have 100 or so attachments, I still wouldn't use that method for a number of reasons.
For certain image file types, the increase in Access file size is far greater than the actual image file size.
Even if you don't reach 2 GB, having an extremely large database will affect performance.
If you ever decide to upsize to SQL Server, you can't use any multivalued fields of which attachments are a subtype.
Also if you ever replace any images with a new copy in the same location, you would need to re-attach the file.

All in all, the attachment method has too many disadvantages and it really isn't any easier to use

Attached is a link to another example database showing how to view images using the file path. I'm fairly sure I've given you this link already.
Folder Image Viewer - Mendip Data Systems
 
Last edited:
Attached is a link another example showing how to view images using the file path. I'm fairly sure I've given you this link already.
Folder Image Viewer - Mendip Data Systems

Even if you only ever have 100 or so attachments, I still wouldn't use that method for a number of reasons.
For certain image file types, the increase in Access file size is far greater than the actual image file size.
Even if you don't reach 2 GB, having an extremely large database will affect performance.
If you ever decide to upsize to SQL Server, you can't use any multivalued fields of which attachments are a subtype.
Also if you ever replace any images with a new copy in the same location, you would need to re-attach the file.

All in all, the attachment method has too many disadvantages and it really isn't any easier to use
Of course you can control what attachment filetypes are allowed - but I agree, if you have the luxury of a userbase with a shared local network, you should use the preferred method - storing the path to the image only.
 
Ok MajP, so there is special form to set the path to the picture folder. But when we are in the form, let say on the new picture, how can we put it to the table, if possible, can it auto guide us to choose the picture
I modified the demo to show how to do that. I put a button to select a file from the default folder.
More realistically you would want to select a file then if it is not in the default folder, move it to the default folder as well as saving the name.
 

Attachments

I modified the demo to show how to do that. I put a button to select a file from the default folder.
More realistically you would want to select a file then if it is not in the default folder, move it to the default folder as well as saving the name.
Thank you MajP, I will look into it
 

Users who are viewing this thread

Back
Top Bottom