Microsoft KB Archive/191103

= BUG: ADO Bound OLE Control Does Not Display Bitmap =

Article ID: 191103

Article Last Modified on 3/2/2005

-

APPLIES TO


 * Microsoft Visual Basic 6.0 Enterprise Edition
 * Microsoft ActiveX Data Objects 2.0
 * Microsoft ActiveX Data Objects 2.1 Service Pack 2
 * Microsoft ActiveX Data Objects 2.5

-



This article was previously published under Q191103



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
 Create a DSN to NWind.MDB and name it NWind. Create a Standard EXE Project in Visual Basic. Under the Project menu, click Components and select the Microsoft ADO Data Control check box.  Drop the ADODC control on the form, and set the following properties:      ConnectionString: DSN=NWind RecordSource: Select * from Employees   Add the OLE control to the Form and set the following properties: <pre class="fixed_text">        DataSource: ADODC1 DataField: Photo </li> Try to set the OLE Control's Data Source property in Property sheet.</li></ol>

<div class="references_section">