View Full Version : Embedding Loads of Photos
abbyfaust 01-26-2007, 03:48 PM I am wondering if it is possible to embed all of the photos that I have into my photo table automatically. I have the table set up with all of the data that needs to be there but I have over 1500 photos that need to be embedded and wanted to save myself some time and automate the process somehow. I already know that embedding these photos is going to make my database huge but that isn't an issue for this particular project.
As far as I can tell from this forum, the help and the Northwind database this isn't possible without manually going through every photo but I am pretty new to Access so thought I would throw the question out there.
Thanks
Moniker 01-26-2007, 04:41 PM Look at the FileSystem Object. You want all your photos in one folder on your computer. From there, you can cycle through each file (in this case, each photo) in the folder and perform tasks on them, like importing. You can also do this with the FileDialog object.
abbyfaust 01-26-2007, 04:57 PM Thanks,
I'm looking through it now...
Abby
The_Doc_Man 01-26-2007, 10:04 PM Abby, let me add that if all the photos are in the right folder, it is possible (using the filesystem object) to locate the fully qualified file specs of each photo and add them to a record in your database, then just LINK to the photos. As long as they are always in the right folder, this is just as fast as embedding - and your database doesn't grow by leaps and bounds with the addition of just a couple of photos. When I take my vacation pix onto a digital medium and import them, I have a little routine that looks for the files, uses a DLookup to see if the file is new, and if not, appends it to the list of pix. My form uses an OnCurrent to load the file name to an image object, to the .picture property. The only difference is that I'm not occupying DB address space for embedded pix.
abbyfaust 02-05-2007, 06:49 PM That sounds good too. I kind of am stuck embedding them but thanks for writing. I need all the help I can get.
Abby
freakazeud 02-06-2007, 06:39 AM Hi,
it is not advised to embed images within an Access application in all versions prior to the new 2007 edition. Access has a known bloating issue that will make you run into problems with the 2GB file size limit. As mentioned before just link to the files with a text datatype table field which holds the relative or absolute string path to the images (relative would be better...make the folder a subfolder of the application directory).
Access 2007 handles this much nicer with the new attachment data type which lets you add one or multiple attachments per record without the negative bloating effect.
HTH
Good luck
abbyfaust 02-08-2007, 06:11 PM Thanks for writing....unfortunately i am stuck embedding photos (it is what the client wants)...but if i ever need to make a database for my use or for something else at work i will definately take yours and everyone else's advice...
Thanks again!
Abby
ChrisO 02-08-2007, 09:15 PM Depending on the definition of bloat, and just why the customer wants them embedded, there may be a method.
For example… bloat:
1500 JPEG images @ 20,00 bytes per image = 30,000,000 bytes total.
(Not too big for Access or hard drives.)
There is no bloat in that calculation and I doubt if A2007 will improve on it unless they try to use compression which, technically speaking, is not good practice on already compressed image files.
Regards,
Chris.
The_Doc_Man 02-09-2007, 10:18 AM Abby, if your client wants this, you have a responsibility of sorts to tell him/her "ARE YOU NUTS, YOU WHACKO POINTY-HAIRED MANAGER?"
Or, if you think tact is more important, .... ;)
As a consultant, you have the responsibility to do what your customer wants. BUT you also have the responsibility to look out for your customer's mistaken ideas that have negative effects on their desired end goal. You should calmly, clearly explain that embedding an object in an Access DB is strictly disadvantageous and even perhaps prohibitive in the long run. You see, in order to build a database with a lot of embedded, hi-res pictures, you need the database itself to be big enough to hold all those pix - but you ALSO need swap space large enough to hold all those pix. If you run out of swap space, you will be unable to open the DB. Linking the pix makes the DB so much smaller that you will hardly ever run into the swap-space problem.
Anthony George 02-11-2007, 04:02 AM This sample database uses:
1 Table with 1 Field
1 Form with 1 text box linked to the field in the table and 1 image frame
The folder in the zip file is called images and contains both the database and 6 pictures.
The folder path should be C:\images
I know it is a linked system and not an embedded one, but I wanted to show you just how easy it is.
Regards
Tony
16342
PS The only code in it is:
Private Sub Form_Current()
Me![imagepath].SetFocus
Me![imageframe].Picture = Me![imagepath].Text
End Sub
galanthus 02-21-2007, 08:37 AM Well I know I'm a pain but I've really tried with this. In the link you sent me I can't see any flags on the form. Also when I make my picture frame on the form, it disappears when I go back to form view. I guess VB is beyond me.
I noticed on the trial of Access2007 there is a sample database for students. For each student a picture is added using the new attachment feature. I would have thought this would be potentially a lot of pictures. Any thoughts??
Its just I've created quite a nice little database and the pictures are the only thing causing problems.
Regards Sue
Anthony George 02-21-2007, 11:47 AM Hi Sue
Sue I will create you a blow by blow account on how to do this but it may not be finished this evening.
Regards
Tony
abbyfaust 03-14-2007, 03:15 PM Just wanted to update anyone who helped me with my photo questions...
I embedded 2000 photos and am having no problems with Access....the database isnt even 1 GB.
anyway, thanks for helping me to anyone who has helped me to learn everything I now know about Access.
Abby
galanthus 03-28-2007, 08:15 AM Just to let those who helped know, I've finally got the hang of it!!!!!!!!!!!!!
Many Thanks Sue
neileg 03-28-2007, 08:36 AM Please that you're pleased. Just so you know, Access will let you do all sorts of things that are just plain wrong in terms of good design. Even the wizards can generate code that is obsolete.
The_Doc_Man 03-28-2007, 09:55 AM Yeah, Neil's got that right. But even though the wizards are as dumb as a box of rocks, they are still your friends if they help quickly build the scaffolding that you need to flesh out your DB. After all, it isn't like you have to keep EVERYTHING they build once you are up and running...
|
|