Subject Re: [IBO]
Author Dmitry Beloshistov
Hello, Jason!
You wrote to "IBObjects (E-mail)" <IBObjects@yahoogroups.com>; "Delphi
Programing (E-mail)" <delphi-programming@yahoogroups.com> on Mon, 19 Aug
2002 13:18:37 +0200:


JF> What is the best way of storing a file into a blob field on Firebird
JF> using
JF> IBObjects as the components?
For text - TIB_Memo,TIB_RichEdit... Else - via TIB_Query...
JF> A code snippet would be much appreciated.

try this:
IB_Transaction1.StartTransaction;
with IB_Query1 do
begin
close; sql.clear;
sql.add('INSERT INTO MY_TABLE(BLOBFIELD) VALUES(?BLOBFIELD)');
Prepare;
ParamByName('BLOBFIELD').LoadFromFile('D:\Temp\MyTestFile.txt');
ExecSQL;
end;
IB_Transaction1.Commit;

or this:
//- open query for data update
IB_Query1.SQL.Text:='SELECT * FROM TESTTABLE FOR UPDATE';
IB_Query1.Open;
.......... append new record into table with BLOB ............
with IB_Query1 do
begin
Append;
FieldByName('TESTBLOB').LoadFromFile('D:\Temp\MyTestFile.txt');
Post;
end;

WBR, Dmitry Beloshistov AKA [-=BDS=-]
e-mail: torin@...