473,326 Members | 2,081 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,326 software developers and data experts.

Reading a picture from an "Ole Object" field in an access database

I have a picture stored in an ole field in one of my access databases. Im
trying to put that picture into a picture box in one of my vb.net programs.
Unfortunately I keep on getting a type cast error whenever I try to copy it
there (through code) If I set a variable to variant and then read the value
into there, it wont error out on me and it's no longer set as nothing so
something was read into it but I still can't type cast the variable as an
image and copy it to the picture box. Can someone help me with this please.
Nov 20 '05 #1
3 8669
"Marco Castro" <ma***@benlan.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have a picture stored in an ole field in one of my access databases. Im
trying to put that picture into a picture box in one of my vb.net programs. Unfortunately I keep on getting a type cast error whenever I try to copy it there (through code) If I set a variable to variant and then read the value into there, it wont error out on me and it's no longer set as nothing so
something was read into it but I still can't type cast the variable as an
image and copy it to the picture box. Can someone help me with this

please.

Are you using VB 6, or VB.NET?
Nov 20 '05 #2
VB.Net

"Jeremy Cowles" <jeremy.cowles[nosp@m]asifl.com> wrote in message
news:Vt*********************@twister.tampabay.rr.c om...
"Marco Castro" <ma***@benlan.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have a picture stored in an ole field in one of my access databases. Im trying to put that picture into a picture box in one of my vb.net

programs.
Unfortunately I keep on getting a type cast error whenever I try to copy

it
there (through code) If I set a variable to variant and then read the

value
into there, it wont error out on me and it's no longer set as nothing so
something was read into it but I still can't type cast the variable as an image and copy it to the picture box. Can someone help me with this

please.

Are you using VB 6, or VB.NET?

Nov 20 '05 #3
Have you tried Drawing.ImageConverter.ConvertFrom(object) ?
"Marco Castro" <ma***@benlan.com> wrote in message
news:OK**************@TK2MSFTNGP12.phx.gbl...
VB.Net

"Jeremy Cowles" <jeremy.cowles[nosp@m]asifl.com> wrote in message
news:Vt*********************@twister.tampabay.rr.c om...
"Marco Castro" <ma***@benlan.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
I have a picture stored in an ole field in one of my access databases. Im trying to put that picture into a picture box in one of my vb.net

programs.
Unfortunately I keep on getting a type cast error whenever I try to copy
it
there (through code) If I set a variable to variant and then read the

value
into there, it wont error out on me and it's no longer set as nothing
so something was read into it but I still can't type cast the variable as

an image and copy it to the picture box. Can someone help me with this

please.

Are you using VB 6, or VB.NET?



Nov 20 '05 #4

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

Similar topics

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: Léopold VALLAURI | last post by:
Hi I have an Access file where is stored some JPG picture in an OLE Field Picture are stored with data added for OLE management.in the field but this data are different for each picture ! I...
6
by: david epsom dot com dot au | last post by:
When I open the table directly, I can see "MS PhotoEd.3" Sometimes when the field is selected, I see "Microsoft Photo Editor 3.0 Picture" Is there anyway I can use VBA to get this information? ...
3
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 if the picture (an integer) and one (column named picture) is a field of type OLE Object which...
3
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 if the picture (an integer) and one (column named picture) is a field of type OLE Object which...
1
by: Jozef | last post by:
Hello, I have some blob code that I use to polulate an OLE field with various files. Some of the files are images. The information in the field says "Long Binary Data" regardless of what I am...
8
by: Mark | last post by:
Hello. I am attempting to write binary data from a file to an OLE Object field, and then write the file back out from the database. I am reading and writing the files in binary mode, and using...
0
by: Skiran | last post by:
Hi to everybody, I am handling a large-scale project of 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)...
2
by: ashishkhawale | last post by:
i m doing Student Info program in VB6 using Access2000 for database i have connected the file using ADO and Microsoft jet oledb 4.0 the data is connected with vb form but i have sotred student...
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: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
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: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
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...

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.