Technical Information Database TI755D.txt Getting a query's Memo field as a string Category :Database Programming Platform :All Product :Delphi 1.0 Description: Returning a Memo value to an Edit field without using a memo field. Place a query object on your form (Query1) Place a Edit object on your form (Edit1) Place a Button object on your form (Button1) Double-Click on the query and add the memo field. (Biolife.db using notes field) Set Query1's SQL property to: Select * from Biolife Set Query1's Active property to: True Add the following code to Button1's OnClick event: procedure TForm1.Button1Click(Sender: TObject); var bs : TBlobStream; p : array [0..50] of char; begin FillChar(p, SizeOf(p), #0); bs:= TBlobStream.Create(Query1Notes, bmRead); try bs.Read(p,50); finally bs.Free; end; Edit1.Text:=StrPas(p); end; Reference: 7/16/98 4:33:53 PM
Last Modified: 01-SEP-99