Character set problems.

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for SQL Server in Delphi and C++Builder
Post Reply
bdipso
Posts: 4
Joined: Fri 14 Oct 2005 11:31

Character set problems.

Post by bdipso » Fri 14 Oct 2005 11:43

Hi we have an application written in Delphi. And it is using your dbx components to connect database. (We did not wrote this application)

We have problems with Turkish characterset. First; if we change MS SQLServers collation to Turkish... application does not work, because of some capital letter differences in Turkish.

So we decided to use Latin2_CP1 collation on SQL Server, and we changed only collation of the fields that user can enter text data to Latin1_CP1254

Now if we use dbexpmss.dll we can enter Turkish data to these fields, but some parts of the program is not working.

if we use dbexpsda.dll it converts Turkish caharacters to Latin equivalents.

Is there a way that I can correct this using dbxconnections.ini or dbxdrivers.ini? Because we can not modify the program.

Best regards.

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Fri 14 Oct 2005 14:48

Do you have Turkish as default charset on your system?

bdipso
Posts: 4
Joined: Fri 14 Oct 2005 11:31

Post by bdipso » Mon 17 Oct 2005 09:17

Yes, Turkish is the default Locale, Language, Keybord Layout, Language for unicode programs ..... , whatever you can find under "Regional and Language options"

SQL Servers Language is Latin1_General_CP1_CI_AS
Databases Language is Latin1_General_CP1_CI_AS
Collations of All the tables are Latin1_General_CP1_CI_AS
Only collation of some varchar and nvarchar fields are Turkish_CI_AS.

bdipso
Posts: 4
Joined: Fri 14 Oct 2005 11:31

Post by bdipso » Mon 17 Oct 2005 09:40

Sorry

Only collation of nvarchar fields set to Turkish.

I can write Turkish characters to these fields using SQL Query Analyzer and Borland DbExpress drivers.

We'r using SQL Server 2000 SP 3

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 17 Oct 2005 09:58

Please use SQL Profiler to trace differences in connection between dbexpmss and dbexpsda.dll

bdipso
Posts: 4
Joined: Fri 14 Oct 2005 11:31

Post by bdipso » Mon 17 Oct 2005 14:38

Hi,

I tried SQL Profiler

I think the difference is parameter passing :

Your driver passes parameters as VARCHAR, whatever the data type of the table column.

exec sp_executesql
N'update "projwbs" set
"wbs_name" = @P1
where
"wbs_id" = @P2 and
"wbs_short_name" = @P3 and
"wbs_name" = @P4',
N'@P1 varchar(40),@P2 int,@P3 varchar(20),@P4 varchar(36)',
'Multidisciplinary General Contractor şığ', 4264,
'Innovative Construct', 'Multidisciplinary General Contractor'

But Borland Driver passes them as NVARCHAR if the column is NVARCHAR.

declare @P1 int
set @P1=2
exec sp_prepexec @P1 output,
N'@P1 nvarchar(100),@P2 int,@P3 varchar(40),@P4 nvarchar(100)',
N'update "projwbs" set
"wbs_name" = @P1 where
"wbs_id" = @P2 and
"wbs_short_name" = @P3 and
"wbs_name" = @P4',
N'Transportation & Infastructure Division şığ', 4265, 'Infrastructure',
N'Transportation & Infastructure Division'
select @P1

(Sorry, I can make Borland driver work in prepare mode. If I make Prepare SQL=False it still preparing the queries)

I dont want to make this discussion longer, if it is not supporting then it is not supporting.

Post Reply