I've a big application using MSSQL as DBMS.
One table contains a field of type Varchar(30)
I use this code to update the field:
ODBCConnection1.Open;
ODBCConnection1.ExecuteDirect('Update TABLE set FIELD1= ' + QuotedStr(Edit1.text) + ' Where ID =2');
ODBCConnection1.Close;
All is fine if the Text doesn't contain accented chars (generally chars having ASCII code > 128).
When I try to insert accented chars what is inserted is not correct.
I made same test using C# and everything works.
The ODBC tracert when Lazarus project1 executes is like this
project1 b254-a528 ENTER SQLPrepare
HSTMT 0x094F1ED0
UCHAR * 0x0256C43C [ 62] "Update TABLE set FIELD1='\ff\ff\ff\ff\ff\ff' Where ID =2"
SDWORD 62
While in C#
WindowsFormsApp ad38-afd8 ENTER SQLExecDirectW
HSTMT 0x064DED20
WCHAR * 0x02D8684C [ -3] "Update TABLE set FIELD1='\ff\ff\ff' where ID= 2\ 0"
SDWORD -3
How can I fix the problem?
Regards
Luca