Page 1 of 1

Unicode characters in select command

Posted: Tue 09 Oct 2007 22:17
by maleks
Hi,

I have an application writen in Delphi 2007 and database on MSSQL.

When command text has unicode chararacters (SELECT * FROM Table WHERE ID='Ф001' )
and application is started on a local machine with regional settings set to English, unicode characters
are converted to "?" and command traced with SQL Profiler is "Select * from Table WHERE ID='?001'".

There is not possible to change default charset on the local machine.

With standard Delphi dbExpress driver dbxmss30.dll, Command is ok.

When command has parameter SELECT * FROM Table WHERE ID=:ID
...Param[0].ASWideString := 'Ф001' there is no problem.


Best Regards,
Maleks

Posted: Thu 11 Oct 2007 08:39
by Antaeus
This happens because DbxSda does not support Unicode in SQL queries. You should use parameters instead.