Page 1 of 1

Convert FieldValue to Stream and Stream to FieldValue

Posted: Thu 16 Aug 2012 05:49
by sinys
How I can convert FieldValue to Stream and Stream to FieldValue?
Like this:
Fields.SaveToStream
Fields.LoadFromStream
for any Field type (string, numbers, date, blob, xml), not only for blob.

Re: Convert FieldValue to Stream and Stream to FieldValue

Posted: Tue 21 Aug 2012 10:30
by AlexP
Hello,

You can use the GetData(Buffer: Pointer) method of the TField for retrieving data and subsequent recording them to Stream with the help of the Write(Buffer: Pointer; Count: Longint) method, processing every field depending on its type