Re:TMemoField: DataSize and GetData
On 9 Feb 1996 04:02:24 GMT, gpige...@powerup.com.au (Guy) wrote:
Quote
>I've got a Paradox 5.0 table and persistent fields in my code. When I
>try to access DataSize of the MemoField, it returns 0, and GetData does
>not work either.
>MyTMemoField.DataSize always returns 0.
>I managed to get around that by saving the MemoField to a TMemoryStream
>and then using .Memory to get the text of the Memo in a Pchar, but this
>is not beautiful.
>Would anyone know why the DataSize and GetData do not work on a simple
>not empty MemoField ?
The on-line help is in error. The GetData and SetData methods and the
DataSize property all work for simple data type components (such as the
TStringField component), but do not work with the complex components like
TMemoField and TBlobField.
For these complex component types, the designed means to read data from or
write data to a memo or BLOB field is with a TBlobStream object. For these
purposes, it has a Read and a Write method. It also has a Size property for
determining the size of the contents of the field.
**************************************************************************
Steve Koterski "Knowledge advances by steps, and not by
Product Group Manager leaps."
Delphi Technical Support -- Lord Macaulay, 1800-1859
Borland International, Inc.