Page 1 of 1

TIBCLoader and Blob Fields

Posted: Mon 02 Sep 2013 11:32
by Denis WILLARD
IBDac 5.0.2 - Delphi 7
Is it possible when using a TIBCLoader, to load data in a BLOB field with a LoadFromfile ?

Re: TIBCLoader and Blob Fields

Posted: Tue 03 Sep 2013 08:33
by AndreyZ
TIBCLoader does not work with fields, therefore there is no direct way to use the LoadFromFile method. As a workaround, you can use the code similar to this one:

Code: Select all

procedure TForm1.IBCLoader1PutData(Sender: TDALoader);
var
  bt: TBytes;
  str: TFileStream;
begin
  str := TFileStream.Create('filename', fmOpenRead);
  try
    SetLength(bt, str.Size);
    str.Position := 0;
    str.Read(bt[0], str.Size);
    Sender.PutColumnData(0, 1, bt); // where zero column corresponds to a blob field
  finally
    str.Free;
  end;
end;

Re: TIBCLoader and Blob Fields

Posted: Wed 04 Sep 2013 17:24
by Denis WILLARD
Thank you,
it is exactly what I needed !

Re: TIBCLoader and Blob Fields

Posted: Thu 05 Sep 2013 05:59
by AndreyZ
I am glad I could help. If any other questions come up, please contact us.