469,326 Members | 1,541 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

Reading access ole fields

Along time ago I created an access database where I used the ole field type
to store images. If I look at the table data it has the work Picture in its
field. The image in that field displays properly if I display it from
inside of access but I can't figure out how to convert what's in there to
anything useful outside of access.

Is there some way to read what's in there from a .net application? I would
be content with just being able to display the picture in an application but
really I would like a way to extract them from there and converting them to
a real picture format. Can someone help me out with this dilemma please.
Thanks.
Nov 20 '05 #1
1 1548
Hi,

Access stores the images in binary format. Here is a function that
converts the binary data into a bitmap. I put a parameter for offset
because the northwind database has an offset of 78.

Private Function ConvertToBitmap(ByVal data() As Byte, ByVal offset As
Integer) As Bitmap

Dim ms As New System.IO.MemoryStream

Dim bm As Bitmap

ms = New MemoryStream

ms.Write(data, offset, data.Length - offset)

bm = New Bitmap(ms)

Return bm

End Function

Ken
-------------
"Marco Castro" <ma**************@benlan.com> wrote in message
news:uS**************@TK2MSFTNGP11.phx.gbl...
Along time ago I created an access database where I used the ole field type to store images. If I look at the table data it has the work Picture in its field. The image in that field displays properly if I display it from
inside of access but I can't figure out how to convert what's in there to
anything useful outside of access.

Is there some way to read what's in there from a .net application? I would be content with just being able to display the picture in an application but really I would like a way to extract them from there and converting them to a real picture format. Can someone help me out with this dilemma please.
Thanks.

Nov 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Dietrich Epp | last post: by
1 post views Thread by Boris Wilhelms | last post: by
16 posts views Thread by Roy | last post: by
6 posts views Thread by efrenba | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by mdpf | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.