
Getting ADO Error- String Truncation
There should have been an SQLState available, but even if there wasn't, this
usually means some buffer allocated for a return value was an inadequate
size.
When calling the ODBC API in "native" mode (that is, not from DAO or ADO or
OLE), for most calls you specify the location (address) and the length of
the buffer to be used to return data; if the database wants to return a
longer piece of data than your buffer, you get this error. Your result will
be the data from the database, truncated.
On an add (insert), you may be allocating a buffer exactly the size of the
data to be added; you may need to "add one" to the size of your buffer to
allow for the terminating null character. Give that a try and see what
happens.
--
Michael Mattias
Tal Systems Inc.
Racine WI USA
Quote:
> Hiya,
> I have a command (stored procedure - MS SQL Server 7) which has a
> parameter which writes to a TEXT (long data, like memo) field, and
> uses the Appendchunk method to append all the data. My code
> calculates the exact data length,and appends that. But when I say
> command.Execute I get the following error:
> Number = -2147217887
> Description = [Microsoft][ODBC SQL Server Driver]String data, right
> truncation
> Source = Microsoft OLE DB Provider for ODBC Drivers
> My Getchunk does not cause any problems, but that actually uses a
> recordset object, not a command.
> Anyone can advise as to what's wrong?
> Thanks,
> Sarah