How can I display OLE "Picture" in VB 2003.Net?

  • Thread starter Thread starter Matthias Müller
  • Start date Start date
M

Matthias Müller

Hello,
not sure if I'm right here, but I didn't find any useful information since
some days on the following problem:

In a small VB.NET program I cut a bitmap and put this small bitmap into the
clipboard. In Access 2003 I paste it to a table - it is represented as
"Bild" (german Version, I guess shoulg be "picture" in englisch).

So far so good, picture can be successfully displayed in Access-Forms in a
bound-OLE-Field.

I want to build another small VB.NET Program, that displays these picuters
too. I get successfully the content of the OLE-Field:
------
Me.OleDbDataAdapterFotos.SelectCommand.CommandText = "SELECT PID, Foto FROM
PersonFoto WHERE PID = 8600"
Dim myDSF As DataSet = New DataSet
Me.OleDbDataAdapterFotos.Fill(myDSF)
Dim myF As System.Data.DataRow()
myF = myDSF.Tables("PersonFoto").Select("PID = 8600")
------

Now the content is MyF - but I foud no way, to display this. If the content
would be a "Bitmap", I could cut off the Header (found somewhere in the
Internet):

------
myMemPictStream = New MemoryStream
myMemPictStream.Write(myF(0)("Foto"), InStr(s, "BM") - 1,
UBound(myF(0)("Foto")) - InStr(s, "BM") + 1)
b = New Bitmap(myMemPictStream)
Me.Foto.Image = b
------

This works fine, but it does not with "Bild" (="Picture").
Any ideas, how I coud manage? Or where I could find help (if I'm wrong
here)?

Thanks to everybody

Matthias Müller
 
Sorry, you'll need to ask in a newsgroup related to VB.Net such as
microsoft.public.dotnet.languages.vb or
microsoft.public.dotnet.languages.vb.control

This newsgroup is for questions about forms in Access, the database product
that's part of Office Professional, and which doesn't use the .Net framework
(yet)
 
Back
Top