Solved

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

Posted on 2002-03-24
7
314 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
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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

When you are entering numbers in a speadsheet, and don't remember what 6×7 is, you just type “=6*7" instead. It works in every cell! This is not so in Access. To enter the elusive 42 in a text box, you have to find a calculator, and then copy the re…
In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now