Writing blobs to MS-Access OLE objects 
Author Message
 Writing blobs to MS-Access OLE objects

I'm having a very frustrating time writing binary data to an MS-Access
table. I'm running MFC Visual C++ 6.0 and MS-Access 97, and from what
I've read in Deja's archives this should be very straightforward, but
it isn't.
       I've reproduced to the problem in a test app, designed by the
AppWizard and written an entirely new database from Access, and
duplicated the problem. I have a single field in the only table in the
database which is an OLE Object. In the class wizard I've tried writing
to that field with both a CBinaryLong and a CByteArray. Everytime I try
writing to the database with CDAORecordset::Update() I'm given a
message (probably from some dll) that the field (the only field) cannot
be null (because the "required" thing is set to true, when designing
the table). I do not have this problem when writing to fields of
type "Text" or "number".
       Can anyone tell me what I'm doing wrong? From what I've read I
shouldn't have a problem writing any kind of binary data to OLE Objects
as long as I use CByteArray-s or CBinaryLong-s. Is there something that
I should be doing in the AppWizard? or could the dlls be out of date?
(I've tried this program in different computers.) I've gone over my
code quite tediously and I don't see what I could be doing wrong.

Sent via Deja.com http://www.*-*-*.com/
Share what you know. Learn what you don't.



Fri, 01 Mar 2002 03:00:00 GMT  
 Writing blobs to MS-Access OLE objects
Hello,
    This isn't the fix to your problem, but a similar situation that happend
with me.
    In Access 97, I set a table's field to Yes/No; then, each time I set the
"filter" in my program to 'True' or 'False' and filtered "m_strFilter =
"OpenClosed = 'True'"" I got a similar message,"Data Type Mismatch in
criteria Expression". In fact each time the program starts I got the
message, and the I filter after that I get an assertion problem message.
    I started to change the case. make True true and then TRUE, then made it
Yes yes YES also nothing happend.
    It turned out that I had two table with the same name and I was changing
the wrong table.  So I repeated what I did above to filter the correct
table.  still didn't work.
    The fix was changing the Yes/No field to text in Access itself.  I don't
know why is it like that, but it worked.

Hassanein

Quote:

> I'm having a very frustrating time writing binary data to an MS-Access
> table. I'm running MFC Visual C++ 6.0 and MS-Access 97, and from what
> I've read in Deja's archives this should be very straightforward, but
> it isn't.
>        I've reproduced to the problem in a test app, designed by the
> AppWizard and written an entirely new database from Access, and
> duplicated the problem. I have a single field in the only table in the
> database which is an OLE Object. In the class wizard I've tried writing
> to that field with both a CBinaryLong and a CByteArray. Everytime I try
> writing to the database with CDAORecordset::Update() I'm given a
> message (probably from some dll) that the field (the only field) cannot
> be null (because the "required" thing is set to true, when designing
> the table). I do not have this problem when writing to fields of
> type "Text" or "number".
>        Can anyone tell me what I'm doing wrong? From what I've read I
> shouldn't have a problem writing any kind of binary data to OLE Objects
> as long as I use CByteArray-s or CBinaryLong-s. Is there something that
> I should be doing in the AppWizard? or could the dlls be out of date?
> (I've tried this program in different computers.) I've gone over my
> code quite tediously and I don't see what I could be doing wrong.

> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.



Sat, 02 Mar 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Writing blobs to MS-Access OLE objects

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

3. Writing blobs to MS-Access

4. format of Ole object field in MS Access

5. OLE objects from MS Access

6. BLOB OLE Object to METAFILE

7. BLOB OLE Object to METAFILE

8. Passing Access Blob/OLE field to a MFC DLL

9. Saving object OLE into BLOB field in MsSQL

10. Passing Access Blob/OLE field to a MFC DLL

11. OLE DB trying to access MS Access queries

12. BLOB in MS Access

 

 
Powered by phpBB® Forum Software