Adding to TMemo field

Quote

> Please excuse the simplicity of this question, but how do you assign a Pascal
> string to a TMemo field in an Access database?  

> I tried Table.Fieldbyname('a').AsString := pasStr;
> but it gave me some error regarding type conversion error. Aren't you suppose
> to be able to do this?

Hi,

I have solved the problem this way:
1. Create a TMemoryStream object.
2. Assign the text you wanna add to the TMemoryStream object.
3. Call TMemoField object's method  LoadFromStream.
4. Free the stream.

Hope this helps. Below is the example of the code I wrote:

--------

var  
   streamText : TMemoryStream;
   PText      : PChar;

...
begin

...
   streamText := TMemoryStream.Create;
   streamText.WriteBuffer(  PText^, StrLen( PText));
   Table.FieldByName('a').LoadFromStream( streamText);
   streamText.Free;
...
end;

Sergej