[Lazarus] freetds + lazarus cannot get around "some character(s) could not be converted" error

Anthony Walter sysrpl at gmail.com
Fri Jul 26 13:45:23 CEST 2019


I am attempting to write a Lazarus program using a TMSSQLConnection on
Linux (Ubuntu 16.04 64 bit) with FreeTDS. Whenever I try to apply updates
on my TSQLQuery component and commit the transaction on its associated
TSQLtransaction component I receive this error:

An error occurred while applying the updates in a record: Connection :
Error 2403 :
Attempt to initiate a new Adaptive Server operation with results pending
Some character(s) could not be converted into client's character set.
Unconverted bytes were changed to question marks ('?')
Some character(s) could not be converted into client's character set.
Unconverted bytes were changed to question marks ('?')
Some character(s) could not be converted into client's character set.
Unconverted bytes were changed to question marks ('?')
Some character(s) could not be converted into client's character set.
Unconverted bytes were changed to question marks ('?')
.

Press OK to ignore and risk data corruption.
Press Abort to kill the program


If I press OK the updates are not actually applied. It looks like no matter
what I do I cannot edit field values and have them applied to the SQL
server database.

I have tried changing the freetds.conf file to include the following:

[global]
client charset = UTF-8


And when I use the tsql command in a Linux terminal with my server I get
the following:

tsql -H <server_name> -p 1433 -U <user_name>
Password:
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
1> exit


I have even tried setting the charset property on the TMSSQLConnection to
UTF-8.

End the end all my attempts result in the same thing. I get that error
message when I apply and commit, and no changes are applied on the actual
database.

Does anyone have any suggestions?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190726/1838cbd2/attachment.html>


More information about the lazarus mailing list