Board index » delphi » How to retrieve unicode memo with ADO?

How to retrieve unicode memo with ADO?


2004-05-25 06:30:58 AM
delphi52
Delphi 7 seems not to support ADO memofield of the type widestring. Is
there any way how to retrieve memo as unicode? Type text works well. Using
SaveToStream of TBlobField does not work eighter...
can anybody help?
Pavel
 
 

Re:How to retrieve unicode memo with ADO?

I've found the best way to deal with these is to create my own class
that inherits from TADODataSet and override InternalInitFieldDefs. I
convert any memo fields to a WideString field (Length = MaxInt).
Here's an excerpt from my TTntADODataSetLX:
procedure TTntADODataSetLX.InternalInitFieldDefs;
var
f: integer;
FieldDef: TFieldDef;
begin
inherited;
for f := 0 to FieldDefs.Count - 1 do begin
FieldDef := FieldDefs[f];
if FieldDef.DataType = ftMemo then begin
FieldDef.DataType := ftWideString;
FieldDef.Size := MaxInt;
end;
end;
end;
--Troy
tnt.ccci.org/delphi_lx_controls/