Board index » delphi » DBMemo Question

DBMemo Question

Hey....

I've got a query that returns a string so long I need a dbmemo to see it...

But I don't want to use a dbmemo to display it, i want to put it in a regular
memo
so it can be edited without having my table open.

So I can't figure out how to get the data out of my query and into my memo
component.

What I'd like to do is something like :

Memo1.lines := Query1.fieldByName('text_strings').asTStrings;

But you there's no such thing as asTStrings;

Any ideas?

thanks.

--John

 

Re:DBMemo Question


Try this:

Memo1.Text := Query1.fieldByName('text_strings').asString;

********************************
Michael Glatz
glatzfa...@aol.com
mgl...@briefcase.com

Re:DBMemo Question


John,

var
   s : String;
begin
   s := Query1.fieldByName('text_strings').AsString;
   Memo1.SetTextBuf(PChar(s));
end;

To update the memo field:

var
   s : String;
begin
   SetLength(s, Memo1.GetTextLen + 1);
   Memo1.GetTextBuf( PChar(s), Length(s));
   Query1.FieldByName('text_strings').AsString := s;
end;

Ken
--
Ken White

Clipper Functions for Delphi
http://members.aol.com/clipfunc

Quote
John0725 wrote:

> Hey....

> I've got a query that returns a string so long I need a dbmemo to see it...

> But I don't want to use a dbmemo to display it, i want to put it in a regular
> memo
> so it can be edited without having my table open.

> So I can't figure out how to get the data out of my query and into my memo
> component.

> What I'd like to do is something like :

> Memo1.lines := Query1.fieldByName('text_strings').asTStrings;

> But you there's no such thing as asTStrings;

> Any ideas?

> thanks.

> --John

Other Threads