Link to home
Start Free TrialLog in
Avatar of G00fy
G00fy

asked on

Insert picture into access database

The question is really simple...
How can I insert a picture into a database. What I want is like:

Item:
ItemID (autonum)
Text (memo)

Picture:
PictureID (autonum)
ItemID (referencing)
Picture (...)

Now I want to have a form where I can enter some details about the pictures and maybe have some kind of slide show where I can see the already inserted pictures.

But I just cannot get it to insert a picture.
Could anyone help me with this? I think I need to have something like VBA to insert it.


Thanks
Avatar of Arthur_Wood
Arthur_Wood
Flag of United States of America image

in general it is NOT a good idea to insert the actual picture file itself into the table - this will rapidly lead to serious database BLOAT.  YOu would be much smarter to inter the PATH to the picture file (as a string) into the table (a Text field), and then load the pocture using the LoadPicture method, passing the filepath from ther table.

You store the actual picture file on disk, and store the file path in the table.  That way youcan easily update the picture, without having to change the database at all.

If you need help with this, just ask.

AW
Avatar of thenelson
thenelson

Avatar of G00fy

ASKER

Arthur: I know that, and I don't want... I don't care about space. But I care about having multiple files... It's just that when I download pictures from the internet, I want to have them saved in the database & then I delete them. Case closed ;).

I only need to be concerned about the database, further nothing.


thenelson: Same reaction for you, it's very nice, but I really really want to insert the pictures into the database.
Well then, you want:
http://www.nosuffering.com/Nelson/ImageDemo.zip
It's designed to save small icons in the database but you can resize the bound object frame.
To enter the picture, view it in an OLE capable image viewer like the Kodak Imaging for Windows that comes with Office 2000.  Copy and paste the image into the bound frame.
Avatar of G00fy

ASKER

This is more like it, but then you need OLE-thingies... And I just want something like saving the bits in the database and getting them out later on...

Because I already looked into the OLE-thingies and it's too bad, but you need (as you said) an OLE capable image viewer, which I have not (checked for imaging on my computer, but I only have "Windows Picture and Fax Viewer").
ASKER CERTIFIED SOLUTION
Avatar of thenelson
thenelson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of G00fy

ASKER

:'( Thanks for the efforts!