473,325 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,325 software developers and data experts.

Read OLE Object field to Image ?

I have a simple problem:
I have an Access database (images.mdb) that has 2 columns: one is the id if
the picture (an integer) and one (column named picture) is a field of type
OLE Object which contains an image (it can store jpg, bmp, gif, but I don't
know what image is stored inside).
I want to retrieve the picture stored in the database and identified by a
given id and display it in a web page (.aspx).
I write in Visual C#, but it does not matter, VB answers are just as
wellcome.
My problem is that this OLE Object field does not contain just the raw array
of bytes that form the image. So I can not just read the array of bytes and
output it to the browser.
no, it contains some extra information about the type of the file stored
(which would be good to know so I can know what kind of image it is). but I
don't know how to get this information.
I also don't know how to separate this information from the actual image.
Does anyone know how to solve this ?

Nov 17 '05 #1
3 4319
> I have a simple problem:

LOL

The following MS Knowledge Base article should help:

http://support.microsoft.com/default...57&Product=acc

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Sandi" <sa***@nomail.ro> wrote in message
news:u9**************@TK2MSFTNGP12.phx.gbl...
I have a simple problem:
I have an Access database (images.mdb) that has 2 columns: one is the id if the picture (an integer) and one (column named picture) is a field of type
OLE Object which contains an image (it can store jpg, bmp, gif, but I don't know what image is stored inside).
I want to retrieve the picture stored in the database and identified by a
given id and display it in a web page (.aspx).
I write in Visual C#, but it does not matter, VB answers are just as
wellcome.
My problem is that this OLE Object field does not contain just the raw array of bytes that form the image. So I can not just read the array of bytes and output it to the browser.
no, it contains some extra information about the type of the file stored
(which would be good to know so I can know what kind of image it is). but I don't know how to get this information.
I also don't know how to separate this information from the actual image.
Does anyone know how to solve this ?

Nov 17 '05 #2
I would like to thank you for your help.
But my problem reffers to something else.
I have no problem in reading the db field where the image is stored as an
OLE object.
I read it ok and I obtain an array of bytes.
BUT. This array of bytes that I read is NOT the actual image!
The problem si that the byte array is made of a header (of variable length)
that is added by Access and then it is continued with the actual image
information.
This is the way an OLE Object is stored. this is the way Access stores
images - as OLE Objects that are different from the actual image (the image
is preceded by a header).
So:
- does anyone know how I can parse this byte array into header + image (so I
can obtain the image) - the header seems to be of variable lenghth...
- or... is there any component (control) that I can use from Visual Studio
that can read the OLE Object (the byte array) and return me the image that
is wrapped inside the OLE Object ?


"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:e1**************@TK2MSFTNGP10.phx.gbl...
I have a simple problem:
LOL

The following MS Knowledge Base article should help:

http://support.microsoft.com/default...57&Product=acc

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Sandi" <sa***@nomail.ro> wrote in message
news:u9**************@TK2MSFTNGP12.phx.gbl...
I have a simple problem:
I have an Access database (images.mdb) that has 2 columns: one is the id

if
the picture (an integer) and one (column named picture) is a field of type OLE Object which contains an image (it can store jpg, bmp, gif, but I

don't
know what image is stored inside).
I want to retrieve the picture stored in the database and identified by a given id and display it in a web page (.aspx).
I write in Visual C#, but it does not matter, VB answers are just as
wellcome.
My problem is that this OLE Object field does not contain just the raw

array
of bytes that form the image. So I can not just read the array of bytes

and
output it to the browser.
no, it contains some extra information about the type of the file stored
(which would be good to know so I can know what kind of image it is). but I
don't know how to get this information.
I also don't know how to separate this information from the actual

image. Does anyone know how to solve this ?


Nov 17 '05 #3
Hi Sandi,

Sorry about that. I didn't look closely enoough at the article. I have seen
this before, and thought that the article I pointed to described this, but I
was mistaken. Check out the following article instead, which should have
enough information for you to parse out the header:

http://support.microsoft.com/default...NoWebContent=1

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Sandi" <Sa***@neomail.ro> wrote in message
news:O$**************@tk2msftngp13.phx.gbl...
I would like to thank you for your help.
But my problem reffers to something else.
I have no problem in reading the db field where the image is stored as an
OLE object.
I read it ok and I obtain an array of bytes.
BUT. This array of bytes that I read is NOT the actual image!
The problem si that the byte array is made of a header (of variable length) that is added by Access and then it is continued with the actual image
information.
This is the way an OLE Object is stored. this is the way Access stores
images - as OLE Objects that are different from the actual image (the image is preceded by a header).
So:
- does anyone know how I can parse this byte array into header + image (so I can obtain the image) - the header seems to be of variable lenghth...
- or... is there any component (control) that I can use from Visual Studio
that can read the OLE Object (the byte array) and return me the image that
is wrapped inside the OLE Object ?


"Kevin Spencer" <ke***@DIESPAMMERSDIEtakempis.com> wrote in message
news:e1**************@TK2MSFTNGP10.phx.gbl...
I have a simple problem:
LOL

The following MS Knowledge Base article should help:

http://support.microsoft.com/default...57&Product=acc

--
HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
http://www.takempis.com
Big Things are made up of
Lots of Little Things.

"Sandi" <sa***@nomail.ro> wrote in message
news:u9**************@TK2MSFTNGP12.phx.gbl...
I have a simple problem:
I have an Access database (images.mdb) that has 2 columns: one is the id
if
the picture (an integer) and one (column named picture) is a field of type OLE Object which contains an image (it can store jpg, bmp, gif, but I

don't
know what image is stored inside).
I want to retrieve the picture stored in the database and identified
by a given id and display it in a web page (.aspx).
I write in Visual C#, but it does not matter, VB answers are just as
wellcome.
My problem is that this OLE Object field does not contain just the raw

array
of bytes that form the image. So I can not just read the array of
bytes and
output it to the browser.
no, it contains some extra information about the type of the file

stored (which would be good to know so I can know what kind of image it is).

but
I
don't know how to get this information.
I also don't know how to separate this information from the actual

image. Does anyone know how to solve this ?



Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: efiedler | last post by:
Hi - I have the following input field on my html page: <input type="image" name="submit" id="submit" src="c:\image.jpg" value="image.jpg"> I also have another input field on the form that is...
0
by: Sandi | last post by:
I have a simple problem: I have an Access database (images.mdb) that has 2 columns: one is the id of the picture (an integer) and one (column named picture) is a field of type OLE Object which...
0
by: Sandi | last post by:
I have a simple problem: I have an Access database (images.mdb) that has 2 columns: one is the id of the picture (an integer) and one (column named picture) is a field of type OLE Object which...
0
by: CroDude | last post by:
Hi all! I have problems when writting bitmap to a byte array and after reading it back form byte to Bitmap object. What I do is this: First I throw Bitmap to a memory-stream and then I write it...
4
by: Piedro | last post by:
Hi group, how do I read a image/blob field in cas option strict is on? First I had it turned off and I read it like this: Dim b() As Byte If Not dsSupp.Tables(0).Rows(0).Item("BITMAP") Is...
2
by: Crimson* | last post by:
I've got a table with an entry type as "OLE Object" in Access 2003. In the form that the table is linked to I want to insert an image (BMP) for each record. However, when I attempt to do so the...
2
by: Skiran | last post by:
I am handling a large-scale project entitled as MIS (Marketing information System). I am using Vb 6 as front end, Ms Access as back end and Crystal report 8 as reporting tool. 1) In the project i...
4
by: Rico | last post by:
Hello, I have an MDE application where I use a bound object frame to display an image. This frame is updatable and bested on the contents of an OLE field. My problem is, some images display as...
3
by: =?Utf-8?B?ZGF2aWQ=?= | last post by:
I try to follow Steve's paper to build a database, and store a small text file into SQL Server database and retrieve it later. Only difference between my table and Steve's table is that I use NTEXT...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.