Reputation: 14622
How can I use Unicode (or just Cyrillic) chars on TStringField.FieldName
property of TClientDataSet
on Delphi?
I've tried this and it doesn't work on the last line:
aStringField := TStringField.Create(aClientDataSet);
aStringField.FieldName := 'аАяЯ';
aStringField.DataSet := aClientDataSet;
aClientDataSet.CreateDataset;
Upvotes: 0
Views: 313
Reputation: 30715
The program below compiles and executes (XE4) without error.
program CDS;
{$APPTYPE CONSOLE}
{$R *.res}
uses
System.SysUtils, db, dbclient;
procedure Test;
var
aClientDataSet : TClientDataSet;
aStringField : TStringField;
begin
aClientDataSet := TClientDataSet.Create(Nil);
aStringField := TStringField.Create(aClientDataSet);
aStringField.FieldName := 'аАяЯ';
aStringField.DataSet := aClientDataSet;
aClientDataSet.CreateDataset;
end;
begin
Test;
end.
Otoh if I use your declaration of aStringField (i.e. as TField) and your method of creating it, I get the r/time error "Invalid field type" on aClientDataSet.CreateDataset.
Upvotes: 1