BUG: ADO Bound OLE Control Does Not Display Bitmap

ID: Q191103


The information in this article applies to:
  • Microsoft Visual Basic Enterprise Edition for Windows, version 6.0


SYMPTOMS

When you try to set the DataSource property for an OLE Control to an ADO Data Control, the following message appears:

No compatible data source was found for this control. Please add an intrinsic Data Control or a Remote Data Control to the form.


CAUSE

The OLE Container Control is not designed to work with the ADO Data Control or its underlying IRowSet interface.


RESOLUTION

You can use the AppendChunk and GetChunk methods to store the data in a long binary data type. This bypasses the problem of the OLE Header information. You can also workaround this problem by using the standard Data Control bound to an OLE Container Control to display the BMP.


STATUS

This behavior is by design.


MORE INFORMATION

For best performance, do not store BLOB(Binary Large Object) data in the database. It is best to allow the native format (that is, BMP, GIF, or PCS files) to hold the pictures. You could have a link in the table to point to the picture file itself.

Steps to Reproduce Behavior

  1. Create a DSN to NWind.MDB and name it NWind.


  2. Create a Standard EXE Project in Visual Basic.


  3. Under the Project menu, click Components and select the Microsoft ADO Data Control check box.


  4. Drop the ADODC control on the form, and set the following properties:
    
          ConnectionString: DSN=NWind
          RecordSource: Select * from Employees 


  5. Add the OLE control to the Form and set the following properties:
    
             DataSource: ADODC1
             DataField: Photo 


  6. Try to set the OLE Control's Data Source property in Property sheet.



REFERENCES

For additional information, please click the article number below to view the article in the Microsoft Knowledge Base:

Q194975 HOWTO: Sample Functions Demonstrating GetChunk and AppendChunk

Additional query words:

Keywords : kbVBp600bug
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: October 5, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.