Re: Displaying Long Binary Data in a Report

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Stephen Lebans (ForEmailGotoMy.WebSite.-WWWdotlebansdotcom_at_linvalid.com)
Date: 04/25/04


Date: Sat, 24 Apr 2004 23:22:23 -0300

John you are using two completely different methods to store data in
your Long Binary field.

1) Manually, in Acess you are inserting the BMP file as an OLE Object.
THe Long Binary field now contains OLE object data.

2) Programmatically inserting Byte data into a Long Binary field. The
Long Binary field does NOT contain OLE object data but simply your raw
binary data.

You should not mix the two data types. While you can programmatically
insert Images as OLE objects I would reccomend against it unless you
will only require a couple of Images.

If the raw Binary data is an exact copy of the original BMP file then
you have several options available to enable you to display the data in
a Report's standard Image control(not one of the OLE Frame controls!).

1)
In the Print event of the Detail section save the contents of the Binary
field to a temp disk file named say "1.BMP".
Set the Image control's Picture property to "1.BMP"

2) Rather than saving a Bitmap file, save a DIB(Device Independant
Bitmap) instead. Then you could easily, without having to save to a TEMP
disk file, load the DIB directly into the PictureData propery of the
Image control.

--
HTH
Stephen Lebans
http://www.lebans.com
Access Code, Tips and Tricks
Please respond only to the newsgroups so everyone can benefit.
"John Dougherty" <anonymous@discussions.microsoft.com> wrote in message
news:6D4B8845-9EA5-4254-A2F2-7356DE167F89@microsoft.com...
> I have an Access 2000 database (TrainingClasses.MDB) containing a
table (ClassHistory) with an OLE Object field (StudentSign).  I have
written a VB.NET application, which populates ClassHistory - the
StudentSign field is being populated with students' signatures (captured
from a PDA device).  My application can read/write the signatures with
no problems (they are originally captured as bitmap images, then my
application stores them into the StudentSign field).  When I am looking
at the table via datasheet view, the StudentSign field shows "Long
Binary Data".  I have noticed that if I manually insert a .BMP file
(through the Access Insert->Object pulldown menu), the field will
display "Bitmap Image" rather than "Long Binary Data".
>
> I have created a simple report in Access to just display all the
fields from ClassHistory.  However, the StudentSign field displays
nothing for those bitmap signatures which were added via my application.
It displays the bitmap signature just fine for a record where I manually
inserted the bitmap image through Access.
>
> Does this issue just boil down to an inherant problem between
populating the data through my program (which is a process not as simple
as just grabbing a .BMP file and sticking it into the field - I have to
use an array into which the bitmap image is loaded, then store that into
the field - fairly complicated process), and Access not being able to
decipher the data that my app has loaded into the OLE Object field?  As
best I can tell, there is no way to programmatically insert a .BMP image
into an Access OLE Object field, and Access still see this as a "Bitmap
Image" (as it does when I manually insert a .BMP image through Access).
>
> Bottom line - am I going to have to just code a report viewer in my
VB.NET application, rather than trying to use Access' report feature?
>
> - Thanks,
>
> JRD


Relevant Pages

  • Re: VB3 is making my head spin!
    ... If you are running at less than full colour depth (16 bit ... machine running at full colour depth will save it as a 24 bit bmp file). ... It is this "what would the depth be of a bitmap that you saved to disk ... Perhaps you have misunderstood the 8 bit colour palette business. ...
    (comp.lang.basic.visual.misc)
  • Re: VB3 is making my head spin!
    ... >machine running at full colour depth will save it as a 24 bit bmp file). ... >It is this "what would the depth be of a bitmap that you saved to disk ... >Accelerator code doesn't handle RLE compression (which I think your own ... define a new palette (I did not know that bitmap definer could also ...
    (comp.lang.basic.visual.misc)
  • Re: Help with SendKeys
    ... converting a 24 bit Windows bmp file to a 4 bit Windows bmp file, ... for an output that is a standard Windows 16 colour bmp file, ... understand yourself and doing it without using any Windows API ... your bitmap code. ...
    (comp.lang.basic.visual.misc)
  • Saving BMP file renders Black Image
    ... I am trying to save a bmp file from a pictureholder. ... // contains a BITMAPINFOHEADER structure and an array of RGBQUAD ... // If the bitmap is not compressed, ...
    (microsoft.public.vc.mfc)
  • Photo Storage
    ... I have a field with a data type of OLE Object. ... field displays "Package" therefore I cannot view the picture in a form. ... another computer when I insert a bmp file, ...
    (microsoft.public.access.tablesdbdesign)