Hello,

I try to read a blob field into a TPicture component but at a certain point my ideas are a its end... confused

Code
   

  With myquery DO
    Begin
      Close;
      DeleteVariables;
      SQL.Clear;
      SQL.Add ('Select mypic from mytable ');
      SQL.Add ('Where ID = :ID ');
      DeclareVariable('ID', otInteger);
      SetVariable('ID',myID);
      try
        Execute;
        If RowCount = 0 THEN Exit;
        LOB := LOBField('mypic');
        if not LOB.IsNull
          then
            begin

               ???

              Stream := TMemoryStream.Create;
              Stream.Position := 0;
              Pic.Graphic.LoadFromStream(Stream);
            end;
        Close;
      except
         on e: exception do
           begin
            showMessage(e.Message);
            Close;
           end;
      end;
   end;
Can you please give my a hint ?

Thanks

Thomas
A TLOBLocator is a TStream descendant, so my guess would be:

Pic.Graphic.LoadFromStream(LOB);
Sometimes things are so simple ...

Thanks for your help.

Thomas
Hi,

have you also a solution for selecting a blob field into TPicture using TOracleDataSet?

Best regards
Rolf
© Allround Automations forums