Re: How to insert/download files using BLOB field.



Steve,

Many thanks.

I. Nemlich


"Steve Zimmelman" <skz@xxxxxxxxxxxxxxxxxx> wrote in message
news:451af570$1@xxxxxxxxxxxxxxxxxxxxxxxxx
AdoQuery.Append ;
TBlobField(AdoQuery.FieldByName('MyBlob')).LoadFromFile('SomeFile');
AdoQuery.Post ;

You don't need any special SQL statement to get the file data. A simple
select statement that includes the blob will do. Then...

AdoQuery.SQL.Text :=
'Select MyBlob From MyTable Where <SomeCondition>';

AdoQuery.Open ;

TBlobField(AdoQuery.FieldByName('MyBlob')).SaveToFile('SomeFile');

Or

Var
AStrm : TMemoryStream ;

AStrm := TMemoryStream.Create ;
TBlobField(AdoQuery.FieldByName('MyBlob')).SaveToStream(AStrm);
AStrm.SaveToFile('SomeFile');
AStrm.Free ;

-Steve-

"IN" <inasakim@xxxxxxxxxx> wrote in message
news:45199c3d@xxxxxxxxxxxxxxxxxxxxxxxxx
Hello,

How to insert a file into a BLOB field and how to download it using ADO
and SQL clause.
I use Delphi 6 Pro.

TIA & best regards

I. Nemlich





.



Relevant Pages

  • Re: How to insert/download files using BLOB field.
    ... You don't need any special SQL statement to get the file data. ... statement that includes the blob will do. ... AStrm: TMemoryStream; ...
    (borland.public.delphi.database.ado)
  • Passing BLOB to exe
    ... I am storing file data in a BLOB and would like to pass it to the ... I want the exe that I pass the file data to ...
    (microsoft.public.dotnet.languages.csharp)