Page 1 of 1

Problem to Display WideString in WideString's CalcFields

Posted: Tue 16 Aug 2005 13:50
by akiraiu
Settings are following:
ODAC 5.55.0.21
Delphi 7.1
OraSession Options (Net = False, UseUnicode = True)
TntUnicodeControls for display Unicode (download from http://www.tntware.com/delphicontrols/u ... nloads.htm)

I created the CalcFields in Design-Time with calsFieldTest : TWideStringField.
The OraTable1 contains "wStr" WideString Field, "calsFieldTest" is CalcFields.

procedure TForm1.OraTable1CalcFields(DataSet: TDataSet);
begin
DataSet.FieldByName ('calsFieldTest').Value := DataSet.FieldByName ('wStr').Value;
end;

The Result fail to display wStr Value in the calsFieldTest CalsField.

Posted: Wed 17 Aug 2005 04:25
by akiraiu
By the way, the above also appear in displaying widestring lookup field in table.

Posted: Wed 17 Aug 2005 07:41
by Paul
You cannot use TWideStringFields as lookup field due to the realization of
TWideStringFields in DB.pas. TWideStringField allocates only 4 bytes for lookup record buffer.
Please see realization of TWideStringField.GetDataSize and TWideStringField.SetAsWideString

Posted: Wed 17 Aug 2005 08:14
by akiraiu
Then how about the CalsField store the widestring value?
Is it the same problem??

Posted: Wed 17 Aug 2005 09:06
by Paul
Calculated fields use the buffer which is same for lookup fields. And it is too small for TWideStringField.

Posted: Wed 17 Aug 2005 10:17
by akiraiu
OK. If I want to display some unicode word (portuguese) to calsfields, but I can not use TWideStringField to store it, Then how to display the unicode word?
If I use TStringField to store, I will lose the some unicode word (portuguese).