#28 MSSQL: String data, right truncation, ODBC SqlState: 22001

open
nobody
None
6
2007-04-18
2007-04-18
chr555
No

Writing a SQL_LONGVARBINARY field with a parameter that is longer than 255 bytes you get this error.

See also:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbccolumn_size.asp

Here's how we fixed this:

In DbxOpenOdbc.pas:

Beginning line 12143 insert following code:

// fix of a "Gupta" fix that does not work with MSSQL
fOdbcParamCbColDef := Length;

Discussion

  • chr555

    chr555 - 2007-04-18
    • priority: 5 --> 6
     
  • chr555

    chr555 - 2007-04-19

    Logged In: YES
    user_id=1463595
    Originator: YES

    Correction:

    The following lines have to be inserted at line 12143

    if( fOdbcParamSqlType = SQL_LONGVARBINARY ) then
    fOdbcParamCbColDef := Length;

     
  • Vadim V.Lopushanskiy

    Logged In: YES
    user_id=644745
    Originator: NO

    >http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/odbccolumn_size.asp
    location not found
    >Beginning line 12143 insert following code
    Indicate more exactly in what place of the code were a change (bring more code).

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks