can not write a BLOB
Posted in 2003
I have a Windows OLE DB COM application written in Microsoft C++ that processes MSSQL tables containing BLOB columns. I need to port this code for use over an Informix database. I have installed the Informix Client and registered the Informix OLE DB provider. The existing code can read Informix tables with BLOB columns with the column type set to DBTYPE_IUNKNOWN, but it cannot insert or update a table with a similar BLOB column. I have tried modifying the code to (1) write the BLOB data using the provider-provided storage object and (2) specify a consumer-provided storage object. The former appears to do nothing to the rowset and the latter generates a unsupported conversion (0x80040E1D) error when the code calls (IRowset::)SetData(). Any help or coding examples would be appreciated. class CBlobAccessor { public: LONG m_objectid; ISequentialStream* m_edoc; BEGIN_COLUMN_MAP(CBlobAccessor) COLUMN_ENTRY(1, m_objectid) BLOB_ENTRY(2, IID_ISequentialStream, STGM_READ, m_edoc) END_COLUMN_MAP() BEGIN_PARAM_MAP(CBlobAccessor) COLUMN_ENTRY(1, m_objectid) END_PARAM_MAP() DEFINE_COMMAND(CBlobAccessor, _T("SELECT object_id, edoc FROM edocument WHERE object_id = ?"))