CLongBinary data truncation



Hi,
I am using ODBC with mfc. I have a field varbinary ( max ) in database,
i can load this field but when I try to create a new row with more than
8000 bytes it gives me "String data, right truncation" error. The MFC
documentation says that database field is too small, but it can be,
field is varbinary(max ).
Any idea?.

arrByet contains information.


binary->m_hData = GlobalAlloc ( GPTR, size );
binary->m_dwDataLength = GlobalSize ( binary->m_hData );
unsigned char* data = ( unsigned char* )GlobalLock ( binary->m_hData
);
memcpy_s ( data, size , arrByte, size );
GlobalUnlock ( binary->m_hData );
// Forzamos la actualizacion del campo.
SetFieldDirty ( binary, TRUE );
SetFieldNull( binary ,FALSE);

dofieldexchange:

RFX_LongBinary(pFX, _T("[time]"), m_time);

thanks

.



Relevant Pages

  • Re: CLongBinary data truncation
    ... I am using ODBC with mfc. ... 8000 bytes it gives me "String data, ... documentation says that database field is too small, but it can be, ... SetFieldDirty; ...
    (microsoft.public.vc.database)
  • CoCreateInstance failed!!!!
    ... I am a newbie to oledb programming. ... Creation and accessing of database from Win Ce/ Embedded vc++ MFC based ... ultimate aim is to access a sql server database from sql server ce provider ...
    (microsoft.public.data.oledb)
  • Re: How can I rename a database table?
    ... You may want to ask this in an SQL group, but perhaps you'll have to write a stored procedure to do this sort of thing and it could be that the queries you do through the MFC interface are more restricted. ... As a result of my limited database and MFC knowledge I am having ... theDataBase.ExecuteSQL("RENAME oldTableName TO newTableName"); ... Can anyone suggest a way of renaming this table programmatically? ...
    (microsoft.public.vc.mfc)
  • Class design question
    ... I'm creating a database application using MFC (Microsoft Foundation ... entry control (e.g. edit boxes, ... The interface to the database is the same for all these different control ...
    (comp.lang.cpp)
  • Re: Newbie needs help in connecting to an Oracle 10g DataBase from an MFC code.
    ... ,i want to populate data from that database into a form i created using ... I read in the help section of MFC databases that MFC for Windows CE ... These classes support the simple ...
    (microsoft.public.vc.mfc)