Unicode characters in select command

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
maleks
Posts: 4
Joined: Tue 09 Oct 2007 14:39

Unicode characters in select command

Post by maleks » Tue 09 Oct 2007 22:17

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

Antaeus
Posts: 2098
Joined: Tue 14 Feb 2006 10:14

Post by Antaeus » Thu 11 Oct 2007 08:39

This happens because DbxSda does not support Unicode in SQL queries. You should use parameters instead.

Post Reply