Fields options Collation

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ysyang
Posts: 41
Joined: Tue 14 Jun 2005 09:10

Fields options Collation

Post by ysyang » Wed 11 Feb 2009 00:07

Hi

I use Delphi7,SDAC 4.50.0.39, ODAC 6.50.0.39 version.

I'm create sample table at SSMS(SQL Server Management Studio)

Code: Select all

USE [AdventureWorks]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[AA](
  [JPField] [varchar](200) COLLATE Japanese_CI_AS NULL,
  [UTFField] [nvarchar](100) COLLATE Latin1_General_CS_AS NULL,
  [KRField] [varchar](200) COLLATE Korean_Wansung_CS_AS NOT NULL
) ON [PRIMARY]

GO
SET ANSI_PADDING ON
GO
exec sp_executesql N'INSERT INTO AA(JPField, UTFField, KRField) VALUES (@JPField, @UTFField, @KRField)',N'@JPField nvarchar(4),@UTFField nvarchar(8),@KRField nvarchar(3)',@JPField=N'シリーズ',@UTFField=N'enaglish',@KRField=N'한국어'
and execute query

Code: Select all

select * from dbo.AA
Result of SSMS(SQL Server Management Studio)

Code: Select all

シリーズ	enaglish	한국어
Result of Delphi SDAC Query

Code: Select all

シリ?ズ	enaglish	한국어
TMSQuery retrun varchar field to TStringField
When ODAC is TOrasession.options.UseUnicode := True,
TSmartQuery return varchar field to TWideStringField.

if TMSQuery retrun varchar field to TWideStringField,enable display japanese character use TNT Control.

Please tell us how to resolve

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Post by Dimon » Thu 12 Feb 2009 10:02

The point is that SDAC maps varchar fields to TStringField and nvarchar to TWideStringField.
To solve the problem you should change type of fields, that contain japanese characters, to the nvarchar MSSQL type.

Post Reply