Getting ADO Error- String Truncation 
Author Message
 Getting ADO Error- String Truncation

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



Tue, 13 Apr 2004 23:44:36 GMT  
 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



Wed, 14 Apr 2004 20:10:45 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting ADO Error - String Truncation

2. string truncation with crystal reports 8.5 and sql server 7

3. Right String Truncation in SQLServer 2000

4. 01004 - 0 - [Microsoft][ODBC SQL Server Driver]String data, right truncation

5. -2147217889 [ODBC SQL Server Driver] String Data, Right Truncation

6. String Truncation

7. Truncation Issue w/ Strings

8. Data Truncation Error

9. ADO to excel truncation

10. Migrating from DAO to ADO Getting Error 3021

11. Getting useful error codes from ADO/ODBC/SQL

12. Flexgrid populated from ADO control - getting error on large tables

 

 
Powered by phpBB® Forum Software