Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 345
  • Last Modified:

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

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
mars_g
Asked:
mars_g
1 Solution
 
nico5038Commented:
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
 
pkolbusCommented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
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
Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 
mars_gAuthor Commented:
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
 
mars_gAuthor Commented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
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
 
Jim Dettman (Microsoft MVP/ EE MVE)PresidentCommented:
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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now