Re: How to insert/download files using BLOB field.
- From: "Steve Zimmelman" <skz@xxxxxxxxxxxxxxxxxx>
- Date: Wed, 27 Sep 2006 18:04:59 -0500
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
.
- Follow-Ups:
- References:
- Prev by Date: Re: RecordCount and Filtered
- Next by Date: Top 80% query problem
- Previous by thread: How to insert/download files using BLOB field.
- Next by thread: Re: How to insert/download files using BLOB field.
- Index(es):
Relevant Pages
|