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




"BRoberts" <berdontemail@xxxxxxxxxx> a écrit dans le message de news:
cfd4e$485afa00$45c484bf$32106@xxxxxxxxxxxxxxxxxxxx

"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.

Sorry! i use your first method ... but it was with table using the component
Tdbf (from sourceforge).
I'll try with a component Ttable BDE during the week-end!




.



Relevant Pages

  • Re: [Delphi 6] How can i copy a DbMemo to a Memo?
    ... but i have an error: Access violation at adress ... I'll try with a component Ttable BDE during the week-end! ... I can't recall how VarToStr reacts to a Null variant, ... And that last alternate solution is a good one, ...
    (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. ... but i have an error: Access violation at adress ...
    (alt.comp.lang.borland-delphi)
  • Re: extracting data
    ... Alex Dybenko ... "Jack" wrote in message ... > place the memo box fields at the end. ... >>> Public Function ExtractDetail(textLine As Variant, ...
    (microsoft.public.access.modulesdaovba)
  • Re: extracting data
    ... place the memo box fields at the end. ... >>I am using the following routine to extract data from emailform. ... >> Public Function ExtractDetail(textLine As Variant, ...
    (microsoft.public.access.modulesdaovba)
  • 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)