cheikh1,
Um, why not simply attach a tDBMemo to the underlying tBlobField created from your query?
Assuming that you really need to use a tMemo, use something like this to populate the memo after running your query:
Code:
memo1.Lines.Text := FieldByName( 'BLOBFIELD' ).AsString;
You'll note that this properly handles any line breaks stored in the underlying field.
To see this in context, here's an example based on the following conditions:
1. It uses the PROJECT table from the employee.gdb sample database provided with InterBase. (The PROJ_DESC field is a blob.)
2. ComboBox1 is populated in the form's OnCreate event; it's filled with the results of this query:
Code:
select distinct
PROJ_NAME, PROJ_ID
from PROJECT
So it contains the list of projects in the table.
3. SqlQuery1's SQL property is defined as follows:
Code:
select distinct *
from PROJECT
where PROJ_NAME = :PROJ_NAME
With all this in mind, here's ComboBox1's OnChange event, which demonstrates the earlier line of code in practice:
Code:
procedure TForm1.ComboBox1Change(Sender: TObject);
begin
with SQLQuery1 do
begin
if active then close;
Params[ 0 ].AsString := ComboBox1.Text;
open;
edit1.Text := FieldByName( 'PROJ_ID' ).AsString;
edit2.Text := FieldByName( 'TEAM_LEADER' ).AsString;
edit3.Text := FieldByName( 'PRODUCT' ).AsString;
memo1.Lines.Text := FieldByName( 'PROJ_DESC' ).AsString;
end;
end;
Hope this helps...
-- Lance