Hi,
I am having some problems converting an existing application that uses
DAO to use ADO. The issue is as follows:
Each row of a table in the MDB contains an image of a product as an
embedded object. I need to be able to display this image in a control on
my VB form. The current application does this using DAO, which seems to
provide the OLE Object as a STDPicture that the PictureBox can use.
(i.e. Picture1.picture = rsData!Picture). However, when using ADO this
method does not work as the OLE Object is of the datatype
adLongVarBinary, so the PictureBox does not recognise it as an image. I
have tried binding the PictureBox to the recordset (see below), but this
gives an error. (Error 545 - Unable to bind to field or datamember:
'ProductImage"). The binding does work for all the other columns though
(as they are not images) so I presume the recordset is OK.
<Binding code>
Set picPrizmIcon.DataSource = MyRecordset
picPrizmIcon.DataField = "ProductImage" <= This line gives the
error
</Binding code>
I have not yet attempted saving the OLE Object to file and loading using
LoadPicture(), but this is a bit messy!
Any help appreciated
Best regards,
Paul