Hi All,
I'm facing UNICODE issue in DELPHI XE3.
In Delphi XE3 - DBExpress is not handling UNICODE characters.
e.g.,
Storing & Retrieving UNICODE data in Delphi 2007 is working properly (DB - ORACLE).
But in Delphi XE3 it is inserting/retrieving some junk values.
Procedure INsertRec;
begin
SQLQuery1.SQL.Clear;
SQLQuery1.SQL.Text := 'insert into .ucode values('''+Edit1.Text+''')';
SQLQuery1.ExecSQL;
End;
Procedure ShowRec;
begin
SQLQuery1.close;
SQLQuery1.SQL.Clear;
SQLQuery1.SQL.Text := 'select name from ucode';
SQLQuery1.Open;
while not SQLQuery1.Eof do
begin
ShowMessage(SQLQuery1.FieldByName('name').AsString);
SQLQuery1.Next;
end;
end;
The above code was working fine in Delphi 2007 and it is not working in DELPHI XE3.
Pl help me to resolve this issue.
|
Re: DBExpress and Unicode |
|
> {quote:title=Steve Faleiro wrote:}{quote}
> Steve Faleiro wrote:
>
> > Hi Rajkumar,
> >
> > If you have saved fields in the dataset, then you need to re-create
> > them. This could possibly solve the issue you are experiencing.
> >
> > TStringFields that are saved in the dataset (TSQLQuery for example)
> > components (in the field designer, and thus the object declarations
> > saved in the DFM and PAS files) in Delphi 2007 and earlier versions
> > projects, would become TWideStringField types in versions starting
> > from Delphi 2009.
> >
> > If you have upgraded your Delphi 2007 project to Delphi XE3, and your
> > dataset contains fields previously created, then you need to delete
> > the fields from the dataset field designer and add them again to the
> > dataset. What this will do is remove all the TStringField and
> > re-create them as TWideStringField.
> >
> > As already mentioned, doing this may or may not solve the specific
> > issue you have reported with Unicode text getting corrupted when
> > writing to or reading from the database. The cause may be something
> > completely else eg. a property setting that is required to enable
> > Unicode on the DBExpress connection component that needs to be set.
>
> Another area to check is the settings on the Oracle client software. If
> you app accesses the Oracle database via Oracle client interface
> software installed on the client machine, then you must check the
> settings for the Oracle Client software - there may be a setting to
> control or enable Unicode / character-set translation with client
> applications.
>
>
> --
> Steve Faleiro
Hi Steve,
By installing Oracle 11g with UNICODE (AL32UTF8) , it solves my problem. Now i can able to store/retrieve any UNICODE characters in Oracle 11g DB. But most of the users are using Oracle 10g (NLS_CHARACTERSET=WE8MSWIN1252) , is it possible to change the NLS_CHARACTERSET in 10g DB without ant data loss? or can we export 10g schema to 11g with NLS_CHARACTERSET=AL32UTF8 ?
|