473,703 Members | 5,540 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 4367
> 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.r o> wrote in message
news:u9******** ******@TK2MSFTN GP12.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***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:e1******** ******@TK2MSFTN GP10.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.r o> wrote in message
news:u9******** ******@TK2MSFTN GP12.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$******** ******@tk2msftn gp13.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***@DIESPAMM ERSDIEtakempis. com> wrote in message
news:e1******** ******@TK2MSFTN GP10.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.r o> wrote in message
news:u9******** ******@TK2MSFTN GP12.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
5985
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 a text box. When submitted my form posts its data to a servlet. I can click on the image, and the form is posted and the servlet is ran. However, I was stepping through the debuger of the servlet and I noticed the request
0
1902
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 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...
0
1336
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 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...
0
3602
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 into byte from a stream. Exception (System.ArgumentException: Invalid parameter used) occurs when reading from byte over a memory-stream back to the Bitmap object. Please help, I'm really stuck here! Here's the code I use (Sorry for a long...
4
1944
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 DBNull.Value Then b = dsSupp.Tables(0).Rows(0).Item("BITMAP") end if
2
2386
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 file is inserted and the filename (image.bmp) is inserted in the box with it taking up about half of the box. I didn't have this problem in Access XP. I've tried embedding and linking the file, but this always happens. Can anyone offer any...
2
3156
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 am required to save customers image to database, and it should be shown in individual customer’s report, which will include that image. I had taken OLE field in the database to save images. I had taken Common dialog box control to select image and...
4
11568
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 the image and some display as an icon with the file name below. The process I'm following is as follows; Right click Choose "Insert Object..." Select "Create from File"
3
2959
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 datatype for the file instead of using IMAGE datatype. I can not use SqlDataReader to read the data. I need your help, Thanks. -David (1) I have a table TestFile for testing: ID int FileName navrchar(255)
0
8676
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9266
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9020
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8972
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7878
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6602
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3128
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2467
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2073
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.