Re: [Delphi 6] How can i copy a DbMemo to a Memo?




"Broc_Ex_Co" <brocexco@xxxxxxxxxx> wrote in message news:485a0420$0$834$ba4acef3@xxxxxxxxxxxxxxxxx

"BRoberts" <berdontemail@xxxxxxxxxx> a écrit dans le message de news: db8eb$485841a1$cef89f20$8829@xxxxxxxxxxxxxxxxxxxx

"Broc_Ex_Co" <brocexco@xxxxxxxxxx> wrote in message news:48578894$0$895$ba4acef3@xxxxxxxxxxxxxxxxx
(Sorry for my poor english.)

I have to manipulate a DbMemo in a file and copy it in a Memo.

Table.FieldByName('Memo1').Value is a Variant.

How is it possible to copy it in a Memo?


Many different ways. Two easy ones:

if Not VarIsNull (aTable ['Memo1']) // it will be Null if it's blank or empty, i.e. ''
then aMemo.Lines.Text := aTable ['Memo1']
else aMemo.Clear;

or

aMemo.Lines.Text := aTable.FieldByName ('Mem1').AsString;

Thanx a lot!
I tried your way, but i have an error : Access violation at adress ...... .....

Do you have another suggestion of amelioration?



I gave you two methods, which caused and access violation? If it was both, then I would suspect your code. I did test the methods before posting them.

.



Relevant Pages

  • Re: [Delphi 6] How can i copy a DbMemo to a Memo?
    ... I have to manipulate a DbMemo in a file and copy it in a Memo. ... Table.FieldByName.Value is a Variant. ... but i have an error: Access violation at adress ... I'll try with a component Ttable BDE during the week-end! ...
    (alt.comp.lang.borland-delphi)
  • still a newb Tstringlist
    ... file by loading it into a memo, however when i try to erase the textfile by ... calling the clear procedure i get an access violation code below any ideas ... code to erase file ...
    (alt.comp.lang.borland-delphi)
  • Re: [Delphi 6] How can i copy a DbMemo to a Memo?
    ... I have to manipulate a DbMemo in a file and copy it in a Memo. ... Table.FieldByName.Value is a Variant. ...
    (alt.comp.lang.borland-delphi)
  • Re: [Delphi 6] How can i copy a DbMemo to a Memo?
    ... I have to manipulate a DbMemo in a file and copy it in a Memo. ... Table.FieldByName.Value is a Variant. ...
    (alt.comp.lang.borland-delphi)
  • [Delphi 6] How can i copy a DbMemo to a Memo?
    ... I have to manipulate a DbMemo in a file and copy it in a Memo. ... Table.FieldByName.Value is a Variant. ...
    (alt.comp.lang.borland-delphi)