BUG: ADO Bound OLE Control Does Not Display Bitmap

ID: Q191103

The information in this article applies to:

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

Additional query words:

Keywords          : kbADO200 
Version           : WINDOWS:1.5,2.0,6.0
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbpending

Last Reviewed: August 8, 1998