
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.