IBDac 5.0.2 - Delphi 7
Is it possible when using a TIBCLoader, to load data in a BLOB field with a LoadFromfile ?
TIBCLoader and Blob Fields
-
AndreyZ
Re: TIBCLoader and Blob Fields
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;-
Denis WILLARD
- Posts: 3
- Joined: Fri 23 Aug 2013 12:07
Re: TIBCLoader and Blob Fields
Thank you,
it is exactly what I needed !
it is exactly what I needed !
-
AndreyZ
Re: TIBCLoader and Blob Fields
I am glad I could help. If any other questions come up, please contact us.