Using CLongBinary objects for retrieving BLOB from database 
Author Message
 Using CLongBinary objects for retrieving BLOB from database

Hi,

I'm using Visual C++ 5.0.
I wrote a small MFC program for retrieving WAV files from a FoxPro database
(Visual FoxPro 5.0). For this I use MFC's ODBC classes. When creating a
recordset for retrieving data from the database which contains the WAV files
ClassWizard automatically selects a CLongBinary type as a container for the
retrieved WAV data. But somehow the CRecordset::Open() isn't executed
without errors. When the record it tries to fetch contains no WAV data at
all, MFC generates this exception: "Error in assignment". Just as if the
CRecordset::Open() doesn't know what to do with an empty record (WAV) field.
When the record being fetched contains WAV data, MFC generates this
exception: "Data truncated". The wave files stored in the database however
are all smaller than 40 kB, while a CLongBinary is used to store Binary
LARGE Objects (BLOBs). I suppose the 16 kB file where MFC generated "Data
truncated" for, can't be considered as being large nowadays, can it?

This is how my CRecordset::Open() looks like:

lUserRS.Open(CRecordset::snapshot,_T("select
user_id,name,mailbox,msg_welcome from main"),CRecordset::readOnly)

msg_welcome is a wavefile which gets assigned to a CLongBinary m_msg_welcome

Does anyone have any idea what the problem might be?

Thanks,

Frederiek
--

 Little is better than nothing (in about 50% of all cases).
--



Sat, 14 Jul 2001 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Using CLongBinary objects for retrieving BLOB from database

2. Storing/Retrieving null blobs through CLongBinary objects?

3. Saving and retrieving Ole-Automation objects from Dao and MFC using CLongBinary class

4. Saving and retrieving Ole-Automation objects from Dao and MFC using CLongBinary class

5. How to store BLOB through CLongBinary object?

6. Using CLongBinary To update BLOBs

7. Save BLOB data using CRecordSet and CLongBinary

8. Blob using CLongBinary

9. Using ADO recordset binding to retrieve BLOBs

10. Populating CLongBinary Database Objects

11. (Q) Access a ole object/blob from an ACCESS Database

12. Updating Database using CLongBinary binding

 

 
Powered by phpBB® Forum Software