Posted on 1998-11-19
OS: W95 - MSVC 4.0
I am going really crazy about that. I have a application which makes use of DAO to show and update a given database.
I had no experience to update/add records using DAO until
now - but i thought this couldn't be a problem.
That's where i went wrong - obviously BSTR isn't BSTR isn't
When i try this:
COleVariant cVarField( <CString> );
I get a totally screwed up database. I took a look into the
VARIANT which is passed, and the 'bstrVal' member points
to a wide-character string. This seems to be the cause.
When i look at the VARIANT i get when fetching records, the
'bstrVal' then points to a simple zero-terminated string.
When i look into the documentation, i read 'BSTR is a length
prefixed string ...'.
I really don't want to build a workaround to that. I just
want to know how such a $!§"§$% can happen.
Thanks for a answer which explains this thing :)