PRB: ATL Consumer Wizard Code Truncates SQL Server text field to a 1024 TCHAR ArrayID: Q234146
|
The ATL consumer wizard maps DBTYPE_STR fields, such as SQL Server's text fields, to TCHAR arrays of 1024 bytes instead of an ISequentialStream pointer. The data for the columns is truncated to 1024 bytes.
This behavior is by design.
If data larger than 1024 is expected, you can increase the size of the array in your accessor class. For example, by default your code may look like the following:
TCHAR m_TextColumn[1024];
...
COLUMN_ENTRY(3, m_TextColumn);
Change the 1024 to the desired maximum length of the data.
ISequentialStream * m_TextColumn;
...
BLOB_ENTRY(3, IID_ISequentialStream, STGM_READ,m_TextColumn);
See Q190958 AOTBLOB for example of how to read and update using an ISequentialStream pointer.
Additional query words:
Keywords : kbwizard kbATL210bug kbDatabase kbGrpVCDB
Version : WINDOWS:6.0
Platform : WINDOWS
Issue type : kbprb
Last Reviewed: June 7, 1999