Re: [Delphi 6] How can i copy a DbMemo to a Memo?
- From: "BRoberts" <berdontemail@xxxxxxxxxx>
- Date: Fri, 20 Jun 2008 17:24:45 -0400
"Broc_Ex_Co" <brocexco@xxxxxxxxxx> wrote in message news:485bc692$0$866$ba4acef3@xxxxxxxxxxxxxxxxx
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!
Both methods should work with any tDataSet descendant. An alternate might be something like
aMemo.Lines.Text := VarToStr (aTable.FieldByName ('Memo1').Value)
I can't recall how VarToStr reacts to a Null variant, it should return ''. If it raises an Invalid Variant Conversion exception then one would have to test for Null before the line above.
.
- References:
- [Delphi 6] How can i copy a DbMemo to a Memo?
- From: Broc_Ex_Co
- Re: [Delphi 6] How can i copy a DbMemo to a Memo?
- From: BRoberts
- Re: [Delphi 6] How can i copy a DbMemo to a Memo?
- From: Broc_Ex_Co
- Re: [Delphi 6] How can i copy a DbMemo to a Memo?
- From: BRoberts
- Re: [Delphi 6] How can i copy a DbMemo to a Memo?
- From: Broc_Ex_Co
- [Delphi 6] How can i copy a DbMemo to a Memo?
- Prev by Date: Re: Delphi v5.0 vs 2007
- Next by Date: Re: Where are protected members list?
- Previous by thread: Re: [Delphi 6] How can i copy a DbMemo to a Memo?
- Next by thread: Listening to a rs232 com port ?
- Index(es):
Relevant Pages
|