Loading Images from Access into Image Control

Loading Images from Access into Image Control

Post by Preferred Custome » Sat, 22 Nov 1997 04:00:00



Hi!

My program reads an Access 7.0 database and then populates a label control
array with names. I'm trying to get the program to load an image control
array with either OLE objects in the Access table or by using a reference to
an actual bitmap.

Here's the code:
'recEmpInfo is my recordset
With recEmpInfo
        i = 0
        Do Until .EOF
         Image1(i).Visible = True
         Image1(i).Picture = recEmpInfo!Image   ' *** Here's where it
doesn't work
         Image1(i).ToolTipText = recEmpInfo!Tooltip
         lblEmpName(i).Visible = True
         lblEmpName(i).Caption = recEmpInfo!Name
             .MoveNext
             i = i + 1
        Loop
        .Close
    End With

I've also tried using code like this:

        Picture = recEmpInfo!Image
        Image1(i).Picture = LoadPicture([Picture])

to pass a location like c:\temp\picture.bmp to the LoadPicture
function....no deal. I keep getting type mismatch and a wonderful assortment
of other messages. The problem is definitely in the *** noted line of code.

Can a wiseperson please help me?

Thanks in advance!

Stephen

 
 
 

1. loading image or picturebox control from access 3.0 db w/ DAO

I have and application that uses several tables to generate reports. (VB
4.0-32 and MS-Jet-3.0).  Only one of these tables store image data (dib's,
mostly 256-greyscale bmp's) and that is stored in a Long Binary field.
I have several different forms, each which acts as a front end for a
separate database.  Six of these forms use a routine library which uses DAO
routines to access the data.  The seventh one stores the images in the Long
Binary fields, and I have had to use a data control in order to load the
images into a picturebox control automatically.  Because of the extra code
that I  had to write into this form so that the data won't be corrupted
accidentally by the user, this is a real pain.

  I have seen hints that there is a way to transfer the images directly from
the Long Binary field to the Image or PictureBox controls and vice versa,
but I have been unable to figure out how so far!

Any suggestions?  Any help would be welcome!

2. foreign Key problem

3. Loading Image control from access database

4. FileMaker File to Palm

5. Images Controls that load picture from a recordset without Data Control

6. some nice spam.

7. Cache image (LOAD-IMAGE)

8. Tiny SQL Problem

9. How to load an image to an image field of a SQL Table

10. Problems loading large images into an IMAGE field

11. Image Controls - Image Basic

12. Binding an Image control to an Image field in SQL Server

13. How to display image from mbd database in an Image Control