Subject RE: [IBO]
Author Jason Fischer
Thanks

I will give it a try, but it looks logical enough.

Regards
Jason

-----Original Message-----
From: Dmitry Beloshistov [mailto:torin@...]
Sent: 19 August 2002 14:59
To: IBObjects@yahoogroups.com
Subject: Re: [IBO]


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@...



___________________________________________________________________________
IB Objects - direct, complete, custom connectivity to Firebird or InterBase
without the need for BDE, ODBC or any other layer.
___________________________________________________________________________
http://www.ibobjects.com - your IBO community resource for Tech Info papers,
keyword-searchable FAQ, community code contributions and more !

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/