Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

TMemo to TDBMemo Delphi 4

Status
Not open for further replies.

BRADENSTOKE

Programmer
Jan 2, 2003
24
GB
I have a Memo and want to copy it into a database TDBMemo.
FieldByName('NOTES').AsMemo := Memo1.Lines; doesn't work.
It doesnt like AsMemo.
Does anybody know the correct syntax ?

Frank.
 
I'm assuming that you are using a TTable component called Test. Then the way to update your DBMemo (and write it to the database) is to code something like:
Code:
  Test.Edit;
  (DBMemo1.Field as TMemoField).Assign (Memo1.Lines);
  Test.Post;
The DBMemo1 should have the DataField and DataSource properties set appropriately.

Andrew
 
you can also use

FieldByName('NOTES').AsString := Memo1.Text;

Sam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top