Subject Truncated BLOB with MFC
Author Pierre Fournier
I have a 201078 bytes bitmap stored as a blob. The record has been
added using DTL.

When I try to extract the blob with MFC's CRecordset, it only gets
the first 1024 bytes of it. A "BlobDump" from ISQL indicates that
the blob is indeed complete by allowing me to view the dumped output
file. If I open the database in a text editor, I can also find the
bitmap data and see that it's sequentially all there.

In the CRecordset, I've tried setting the field as a
CLongBinary/RFX_LongBinary() and a CByteArray/RFX_Binary(). I get
the same result in both cases. It seems that SQLGetData() or
SQLExtendedFetch() returns only 1024 bytes.

However, I've found out that SQLGetData() does return
SQL_SUCCESS_WITH_INFO even though it says it has fetched 201078
bytes, according to the last parameter of the function. This
parameter does not say SQL_NO_TOTAL as I think it should.