views:

165

answers:

1

Hi. I have problem with ODAC 6.2. In page about ODAC written that ODAC support Unicode. Now I use TOraSQl component and I connect to Unicode table in Oracle. I can not view Unicode data in table. I see only ANCII code. pls, help me. I think TOraSql doesn't support Unicode ;)

A: 

Disclaimer: I only use DevArt Sql Server Data Access Components, but I guess they are similar enough to the Oracle Data Access Components that it doesn't matter for the purpose of answering your question.

For string fields of the database a TWideStringField component will be created, and its Value property returns a WideString. Something like:

procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
  w: WideString;
begin
  for i := 0 to MSQuery1.FieldCount - 1 do begin
    if MSQuery1.Fields[i] is TWideStringField then
      w := TWideStringField(MSQuery1.Fields[i]).Value;
  end;
end;

So the components most definitely support Unicode, but you can't simply connect a table, a data source component and a grid in Delphi versions prior to Delphi 2009 and expect this to show you Unicode text - the VCL in those Delphi versions isn't able to display Unicode strings. You could use the TNT Unicode Controls, although I can't say whether there are data aware controls (I have no experience with TNT controls).

Alternatively the Virtual Treeview by Mike Lischke works in earlier Delphi versions and is using the Unicode API calls.

But it would be much better to simply use Delphi 2009 with its Unicode-capable VCL.

mghie
Would you recommend SDAC over ADO in Win32? If so, why?
Ertugrul Tamer Kara
I have no experience with ADO, so I can't compare them; however SDAC has served us very well for our projects, and with UniDAC the case has only become stronger - transparent access to several SQL servers while using a very thin layer over the native access library, sensible pricing and good support. Maybe there is no need to switch to SDAC from ADO, but back then when I researched our options for MS SQL Server access from Delphi 5 Professional, SDAC seemed the best option all around, and it has indeed worked well.
mghie