Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

storing images into an image list control from our database

hi all
i am using access 97 and DAO
i want to know how can i populate the imagelist control on the form with the images in my access database at run time.
whats the best way to store images into a database (images are of very small size and few in number not exceeding 25)
[289 byte] By [aks79] at [2007-11-11 8:19:15]
# 1 Re: storing images into an image list control from our database
why doesnt anybody reply
aks79 at 2007-11-11 17:25:40 >
# 2 Re: storing images into an image list control from our database
I don't think it's possible to populate an ImageList control directly from a database. You'd have to extract the images from the database and save them to temporary files, then populate the ImageList from the files.
Phil Weber at 2007-11-11 17:26:40 >
# 3 Re: storing images into an image list control from our database
How are the images stored in Microsoft Access? Have they been saved as OLE objects or just binary data? What is the data type you are using?

As Phil mentioned, the images must first be extracted from the database and saved to a file before they can be added to an ImageList (using LoadPicture).
pclement at 2007-11-11 17:27:38 >
# 4 Re: storing images into an image list control from our database
in access 97 i have declared the field as OLE type but as responded earlier by phil i am trying to save the image into the database by first converting the image into a byte array and then saving the image as BLOB (Using a temporary file) to store the picture
i am using appendchunk and get chunk methods to store and retrieve
is this approach correct!!!!!
aks79 at 2007-11-11 17:28:40 >
# 5 Re: storing images into an image list control from our database
Yes, that would be the correct approach.
pclement at 2007-11-11 17:29:49 >
# 6 Re: storing images into an image list control from our database
thanks paul i am new to vb so having a hard time thanks for the confirmation
aks79 at 2007-11-11 17:30:48 >