Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2019-07

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

4 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Anthony Walter

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>

Reply by email

LacaK
to Anthony Walter

Hello,

Show quoted text 32 lines
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

probably try add also:

dump file = freetds.log

then you can look into log file what and when actually happens ...

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

Yes it is needed

What verision of FPC/Lazarus do you use?
Do you have DefaultSystemCodePage = UTF8 ?
Can you try with TRUNK or 3.2 branch?

What is version of remote SQL Server ?

-Laco.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20190729/c5843215/attachment.html>

Reply by email

Michael Van Canneyt
to Anthony Walter
Anthony Walter wrote 8 lines
Laco, I set the SetMultiByteConversionCodePage(65001) and it worked. Then I removed it and it still worked. The only thing that has changed is that I've rebooted since editing the tds configuration files, so maybe that was the problem. Thanks for responding.

Maybe this kind of info can be added to the Wiki. https://wiki.freepascal.org/SqlDBHowto
seems like a good location...

Michael.

Reply by email