Solved

Saving a bitmap as a bitmap in an Access 2000 OLEObject field using VB6 SP5

Posted on 2002-03-24
7
322 Views
Last Modified: 2013-12-03
I am, for a class project, trying to create a data-entry program in VB6.  The problem I'm having is that when I try to save a bitmap in the database it saves as a "Long Binary Data" as opposed to a "bitmap".  Is there anyway to insert the bitmap as a bitmap?

I have also tried to create an Access 2000 form to do the same (using VBA), but with no success.

Is there anyway to insert a bitmap as a bitmap into an OLEObject field in any of these programs?

  Thank you,

     Ryan Huggins
0
Comment
Question by:mars_g
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 54

Expert Comment

by:nico5038
ID: 6892747
When you insert an OLE object, you can store an image in this. However, this might "bloat" the database.
Normally we store just the path and filename in a text field and then show that using an image control.

The Northwind database has a sample of images stored by the products.
Inserting an object in the OLE can be done by double-clickng on the object.

More info needed?

Nic;o)
0
 
LVL 1

Expert Comment

by:pkolbus
ID: 6892970
Ryan,

I had a similar project back in the days of VB3 and Access 1.1.  We stored the picture data in a Memo field in the database.  I have the original project, if you're interested let me know.

Peter
0
 
LVL 57
ID: 6894029
Ryan,

Take a look at the following MSKB article:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q210486

  which contains the functions WriteBlob and ReadBlob.  Using these, you can store any type of binary data in a OLE field without Access wrapping anything around it.

Good luck with your project,
Jim.
0
Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

 

Author Comment

by:mars_g
ID: 6898446
Nico - I have a question.  I have looked at the Northwind database, and aside from clicking the next record button, I can't see how they acutally save the image.  I'm looking for something along the lines of actual code, if there is any.  Thanks.

Jim- Thanks for the article.  I have followed the instructions verbatim, but I keep getting a "Long binary data" type.  Any ideas?

Peter- Thanks.  I am definetly interested in looking at your original project.  If you could, please send it to Ryan.Huggins@Verizon.Net
0
 

Author Comment

by:mars_g
ID: 6898489
Nico - I have a question.  I have looked at the Northwind database, and aside from clicking the next record button, I can't see how they acutally save the image.  I'm looking for something along the lines of actual code, if there is any.  Thanks.

Jim- Thanks for the article.  I have followed the instructions verbatim, but I keep getting a "Long binary data" type.  Any ideas?

Peter- Thanks.  I am definetly interested in looking at your original project.  If you could, please send it to Ryan.Huggins@Verizon.Net
0
 
LVL 57
ID: 6899093
Ryan,

  Well yes, that's what you will get.  Your storing binary data in a OLE type field, but without the OLE wrapper that Access normally puts on it.  This means that if you double click on the field, nothing will happen has Access does not know how to deal with it.

  If the objective is to actually load the image in the table with the OLE wrapper, then see this MSKB aritcle:

ACC: How to Load OLE Objects from a Folder into a Table (Q158941)

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q158941

  The only way to do this is through a form and the end result is that your database size will increase.  The typical way to deal with images is to store them as seperate files and only store a path/filename in the table.

Jim.
0
 
LVL 57

Accepted Solution

by:
Jim Dettman (Microsoft MVP/ EE MVE) earned 200 total points
ID: 6899098
BTW, Sorry I mis-read your original question.  I just re-read it and the answer is no.

The only way to get the OLE wrapper added is through a form.  The wrapper spec has never been documented, so it's impossible to add it via a programatic means.

Jim.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
AutoNumbers should increment automatically, without duplicates.  But sometimes something goes wrong, and the next AutoNumber value is a duplicate.  This article shows how to recover from this problem.
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question