Page 1 of 1

Fields options Collation

Posted: Wed 11 Feb 2009 00:07
by ysyang
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

Posted: Thu 12 Feb 2009 10:02
by Dimon
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.