Board index » delphi » ODBC Error 'String data, right truncation'

ODBC Error 'String data, right truncation'

Does anyone know what you have to do to pass in a 'TEXT' parameter to MS
SQL Server through ODBC? I get the error message '[Microsoft][ODBC SQL
Server Driver]String data, right truncation' when I try. I'm assuming
its because it thinks the parameter is too long. Is there anyway to
persuade it that it isn't? ISQL does seem to think it is. TIA!

Craig Woodard
Atlas Van Lines, Inc.

 

Re:ODBC Error 'String data, right truncation'


Hi.
I Use the following:
                     SQLBindParameter( fUStmt,NumberModified,
                     SQL_PARAM_INPUT,
                     SQL_C_DEFAULT{dtype},
file://FieldDefs[Counter].DataType,// SQL_INTEGER
                     FieldDefs[Counter].DataType,
                     FieldDefs[Counter].ColSize,//dsize,
                     FieldDefs[Counter].DecimalDigits, // DECIMALS
                     FieldDefs[Counter].BufferAddress ,// bufPos, = NIL HVIS
NULL
                     0,// FieldDefs[Counter].fFieldBufferLength, file://0,
                     FieldDefs[Counter].fFieldBufferLength );

It works for every type of data.
For text variables, I use a string for the buffer. The address would then be
: PCHAR(fStringBuffer) ;
For binary fields, i.e. bitmaps etc, I use a Tmemomystream. The address
would be : Stream.Memory ;

--
Med venlig hilsen/Regards
Stig Johansen - s...@w3data.dk
W3 Data - mai...@w3data.dk

Quote
Craig Woodard <craw...@atlasvanlines.com> wrote in message

news:379DCD16.C1A99519@atlasvanlines.com...
Quote
> Does anyone know what you have to do to pass in a 'TEXT' parameter to MS
> SQL Server through ODBC? I get the error message '[Microsoft][ODBC SQL
> Server Driver]String data, right truncation' when I try. I'm assuming
> its because it thinks the parameter is too long. Is there anyway to
> persuade it that it isn't? ISQL does seem to think it is. TIA!

> Craig Woodard
> Atlas Van Lines, Inc.

Other Threads