473,832 Members | 2,107 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OLE IMages in Access DB

I have a MDB (Access 2002) with OLE Objects in 1 column of a table.

The obj is a GIF. I want to extract the gif and put it in a file in a
directory on a network drive.

Can anyone help me understand how to code the VBA for this?

Thanks
Nov 12 '05 #1
6 7565
If you require a programmatic solution then I will assume you have too
many records to allow you to simply invoke the OLE server program that
inserted them originally and extract them one at a time.

If you can live with Jpeg or Bitmap files then there is a programmatic
solution here:
http://www.lebans.com/oletodisk.htm
A2KExportOLEtoJ PEG.zip A2K ONLY! This version saves the entire
contents of a table containing OLE Object Images to disk based Jpeg
files. User selectable compression rate. Version 1.5

Further conversion to GIF format presents a problem. THe simplest
method would be to use a Paint/Draw program that supports batch
conversion such as Paint Shop Pro. If for whatever reason a code only
solution was required you could easily modify the PictureBoxToGif class
on my site to perform the conversion.
http://www.lebans.com/pictureboxtogif.htm
PictureBoxToGif .Zip is a class that allows the user to save the contents
of a PictureBox to a disk based Gif file. This is a standard Gif file
with compression so please read the Unisys document below. Full Gif
patent info is included in the ZIP file you will be downloading.

--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"John Galt" <js**@yahoo.com > wrote in message
news:i1******** *************@n ews1.epix.net.. .
I have a MDB (Access 2002) with OLE Objects in 1 column of a table.

The obj is a GIF. I want to extract the gif and put it in a file in a
directory on a network drive.

Can anyone help me understand how to code the VBA for this?

Thanks


Nov 12 '05 #2
"Stephen Lebans" <Fo************ *************** *************@l invalid.com> wrote:
If you require a programmatic solution then I will assume you have too
many records to allow you to simply invoke the OLE server program that
inserted them originally and extract them one at a time.

If you can live with Jpeg or Bitmap files


But why? I mean why does the original post have to live with jpg or bmp files. In my
ignorance I would've thought that OLE Objects contain a bit of header information, ie
file path and name and then the data. Furthermore the data would be pretty much
exactly what it would look like on the hard drive.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #3

"Tony Toews" <tt****@teluspl anet.net> wrote
If you can live with Jpeg or Bitmap files


But why? I mean why does the original post
have to live with jpg or bmp files. In my
ignorance I would've thought that OLE
Objects contain a bit of header information,


Because Stephen didn't sign up to write a "general save an OLE Object to any
file form of your choosing" software package. That would be a pretty tall
order for someone doing some freebie software just to satisfy his own
interests, now wouldn't it?
Nov 12 '05 #4
"Larry Linson" <bo*****@localh ost.not> wrote:
But why? I mean why does the original post
have to live with jpg or bmp files. In my
ignorance I would've thought that OLE
Objects contain a bit of header information,


Because Stephen didn't sign up to write a "general save an OLE Object to any
file form of your choosing" software package. That would be a pretty tall
order for someone doing some freebie software just to satisfy his own
interests, now wouldn't it?


Umm, yeah but ....

I'm only trying to understand why the format of the file saved in the OLE object in a
table is any different than the file format of the object in a file on the hard
drive.

Besides Stephen thrives an challenges. <smile>

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #5
Hey Tony,
it's been a long time but if I remember correctly, when the OLE Server
inserts the Image into the OLE object field it can do so in basically
any manner it wishes to. For those files that I have examined, and
depending on the original Image format, the OLE field can contain:
1) An uncompressed Bitmap(DIB) of the Image for display purposes.
2) An uncompressed Bitmap(DIB) of the Image wrappedn within an Enhanced
Metafile.
3) A binary copy of the original file.

The problem is that this is private data and therefore subject to the
designs of the OLE Server. Sometimes a copy of the original file is
present sometimes not.
When the solution on my site exports the contents of the OLE field it
simply asks for a copy of the uncompressed Bitmap to be placed onto the
ClipBoard. I then use the Intel JPG library to save this to disk.

By coincidence, I have spent the last 24 hours working with the
FreeImage library and hooking it up to a standard Access Image control.
It supports loading/saving to almost all of the popular raster Image
formats. I'll post the code to hookup the FreeImage DLL to an Image
control so a developer could then specify basically any raster format
they desire when using my OleExport routines.
--

HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"Tony Toews" <tt****@teluspl anet.net> wrote in message
news:q6******** *************** *********@4ax.c om...
"Larry Linson" <bo*****@localh ost.not> wrote:
But why? I mean why does the original post
have to live with jpg or bmp files. In my
ignorance I would've thought that OLE
Objects contain a bit of header information,
Because Stephen didn't sign up to write a "general save an OLE Object to anyfile form of your choosing" software package. That would be a pretty tallorder for someone doing some freebie software just to satisfy his own
interests, now wouldn't it?


Umm, yeah but ....

I'm only trying to understand why the format of the file saved in the

OLE object in a table is any different than the file format of the object in a file on the hard drive.

Besides Stephen thrives an challenges. <smile>

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm


Nov 12 '05 #6
"Stephen Lebans" <Fo************ *************** *************@l invalid.com> wrote:
it's been a long time but if I remember correctly, when the OLE Server
inserts the Image into the OLE object field it can do so in basically
any manner it wishes to. For those files that I have examined, and
depending on the original Image format, the OLE field can contain:
1) An uncompressed Bitmap(DIB) of the Image for display purposes.
2) An uncompressed Bitmap(DIB) of the Image wrappedn within an Enhanced
Metafile.
3) A binary copy of the original file.
I was thinking after my previous posting that there had to be the internal version of
the file as well. This being the version that we complain about bloating the Access
MDB so much.
The problem is that this is private data and therefore subject to the
designs of the OLE Server. Sometimes a copy of the original file is
present sometimes not.
Ah. I would've thought that somehow, there would be several different "sub objects"
easily figured out via API calls so you can just extract what you wanted.
When the solution on my site exports the contents of the OLE field it
simply asks for a copy of the uncompressed Bitmap to be placed onto the
ClipBoard. I then use the Intel JPG library to save this to disk.
I had figured that much out by looking at your MDB last week. But I was wondering
why all this was necessary. As per my original question. Now I have a better idea.
By coincidence, I have spent the last 24 hours working with the
FreeImage library and hooking it up to a standard Access Image control.
It supports loading/saving to almost all of the popular raster Image
formats. I'll post the code to hookup the FreeImage DLL to an Image
control so a developer could then specify basically any raster format
they desire when using my OleExport routines.


Fabulous. Very fabulous.

Tony
--
Tony Toews, Microsoft Access MVP
Please respond only in the newsgroups so that others can
read the entire thread of messages.
Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm
Nov 12 '05 #7

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

Similar topics

4
6797
by: RichG | last post by:
I have an Access database/forms application that has images stored in it. I need to develop a new VB that utilizes Oracle or the file system as the underlying storage for these images. In order to do this I need to retrieve and save the images to disk in their native format. The problem is that the images are stored in Access as the OleObject type rather than binary. I cannot figure out how to pull these imagesfrom the database and...
4
3442
by: Dom Hicklin | last post by:
I have created a form onto which images can be dropped and thus added to the OLE field of a Table (Access 2000 linked to SQL 2000 server). I use the Stephen Lebans ExportOLE function to do this and it creates images on my shared drive beautifully! Being new at this I wondered if there is an easy way of taking the image whatever it's size when pasted and always exporting it as 66*75?
3
3486
by: Dalan | last post by:
At first I was not certain what could cause Access 97 from displaying most jpeg images, but not all. After further testing, it seemed that all original images of less than 275 pixels per inch or less would display, but those close to 300 pixels/inch or greater would not (MS Access cannot recognize the file format xxx.jpg). The larger, original images were scanned and saved as .bmp (at 300 dpi producing a 15MB file). Then the images were...
3
5646
by: marwa mohamed | last post by:
salamo alikom hi all when i run report that includes image control linked to a field in the table that contains the image path(on the server)and the record source of the report contains over 30 records a messege shows saying: "Microsoft Access doesn't support the format of the file'file path\filename.jpg' or file is too large.Try converting the file to BMP or GIF format". I want to know which one is the problem (the size) or (the format...
3
4078
by: Bob Dydd | last post by:
Hi Everybody I have an Access 2000 db with a setup for inserting images in records. I am using the image path only with the actual images stored elswhere on the hard disc. This works perfectly well with all of Microsoft developer installed on the system. The problem is when I give this to a user who has NOT got Access 2000, ie I just give him an installation that installs a runtime, my frontend/backend and images, an error says that...
3
3832
by: Simon | last post by:
This problem has been driving me mad for months.... Seen a few posts on forums about it but no answers... No mention on MSDN etc. XP Pro SP1, VS.NET (c#) .Net framework 1.1, IIS 5.1. In a nutshell when testing my ASP.NET (localhost) apps images randomly don't load on the page. Examining the IIS logfile shows the missing images give 401 or 403 errors. Here's an example - 10:15:47 127.0.0.1 GET...
3
7469
by: Alan | last post by:
Hi, I'm converting a database application from Access 97 to C#/SQL Server. Old database contains some images in OLE fields. I've figured out that there's OLE header preceeding actual image data and dealt with some of the images which were in standard BMP format but most of the images are in some other format which is displayed ok in access application and can be copy/pasted to any image editor but when doubleclicking it doesn't open any...
12
1650
by: Jon B | last post by:
Hi There! For some reasons, some images of my ASP.NET website are cannot be displayed in the browser (even tho they exists on the server). They are just normal JPG and PNG images and the website has been working fine before. I tried re-upload the original files to the remote server but still no solution. Any ideas? Thank you all in advance!!!
9
3849
by: Wayne Smith | last post by:
I've come up against a major headache that I can't seem to find a solution for but I'm sure there must be a workaround and I would really be grateful of any help. I'm currently building a web site for a small club I belong to and one of the features I would like to include is the ability to allow users to upload image files. unfortunately the servers web root www folder only allows READ and EXECUTE permissions, which makes it...
3
1742
by: anthony | last post by:
I am going to have to start holding jpg files (about 6,000 - 10,000 a year) in our school database. Mainly, they will end up being printed as part of the children's profiles ie via a report. I understand that Access 2007 can hold images without the associated bloat created by previous versions. However, I am reasonably used to Access 2003 and would only want to upgrade if there were significant advantages in the way Access 2007 handles...
0
9796
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10500
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10213
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...
1
7753
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...
0
5624
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5789
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4422
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
3972
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3078
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.