Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SQLBindParameter Error -> String Data, Right Truncation if more 6

49 views
Skip to first unread message

chris

unread,
Jul 31, 2009, 9:51:02 AM7/31/09
to

Hello,
I am struggling on a strange problem with the SQLBindParameter method.

I want to bind a SQL_C_CHAR to SQL_CHAR and get the Error "String Data,
Right Truncation" if the length of the data in one parameter is greater then
6 Bytes. The columnsize in the db-table is greater than 6. If all parameters
are 6 or lower everything works fine.

lendata=length of the STRING , pdata = pointer to the string
retcode=SQLBindParameter(cb->handleStatement, field,PARAM_INPUT,
SQL_C_CHAR, SQL_CHAR, lendata, 0,pdata,0 , &lendata);


I thought that something with codepages,language settings.. but if use the
option AutoTranslate with yes or no in the connection string nothing changes.

I am totally frustrated, I have no idea whats wrong?? Has somebody help.

Russell Fields

unread,
Jul 31, 2009, 5:15:43 PM7/31/09
to
chris,

http://dbaspot.com/forums/sqlserver-odbc/185618-sqlbindparameter-errors-invalid-precision-value.html
In this case the OP had set ColumnSize, but not BufferLength. If I read
your code correctly, it looks like BufferLength is 0. It should probably be
the same as the ColumnSize, namely lendata.

(Note: I am not an expert in this area.)

FWIW,
RLF


"chris" <ch...@discussions.microsoft.com> wrote in message
news:203E2DE2-2022-4ED0...@microsoft.com...

chris

unread,
Aug 3, 2009, 2:53:01 AM8/3/09
to

Thank you for your help Russel, but this hint did not take effect. It makes
no difference to the behaviour with buffer length 0.

Have somebody else an idea?

0 new messages