PDA

View Full Version : extract OLE image from access to file by running sql adobd from vba excel



benben88
08-06-2021, 07:21 AM
hi :)
I would like to run vba adodb sql query which is based on table in MS Access.
In this table , there are images as ole object .

can I read the binary data of those images by this sql (which is running from excel, not directly from access)?
how can I do it?

Sql= "select person.pic from person"

Thanks
Ben

Jan Karel Pieterse
08-11-2021, 08:24 AM
Maybe this article gives you some pointers? https://www.freevbcode.com/ShowCode.asp?ID=1802

benben88
08-18-2021, 12:37 PM
Thanks!
Ineed I get the image file, but i cannot open it.
Is this code supposed running when I call ms access from excel?
Ben

arnelgp
08-18-2021, 05:34 PM
what "type" of field are you trying to extract (attachment, blob)?

benben88
08-18-2021, 07:55 PM
Bitmap picture

arnelgp
08-18-2021, 09:58 PM
open the access db and on design view of your table that has
the bitmap, look at the Datatype of that field (Attachment field or Blob field?)
also post the database name and the tablename and the fieldname.

benben88
08-22-2021, 06:49 AM
open the access db and on design view of your table that has
the bitmap, look at the Datatype of that field (Attachment field or Blob field?)
also post the database name and the tablename and the fieldname.



I did what u asked
Field name- Drawpic
Data type - OLE Object (not attachment)


BEN

arnelgp
08-22-2021, 07:28 AM
OLE object can be extracted but if you are
using Windows 10 (or 11), you might not be
able to open the image.
On earlier version (XP) it is easy to view the
image.

benben88
08-22-2021, 07:34 AM
OLE object can be extracted but if you are
using Windows 10 (or 11), you might not be
able to open the image.
On earlier version (XP) it is easy to view the
image.



Is there any solution for win 10?

BEN