Subject | Re: [firebird-support] How do I Store/Retrieve graphics to/from BLOBs using IBQuery? |
---|---|
Author | Martin |
Post date | 2003-08-15T10:51:17Z |
This might work for you, this answer might be a bit quicker. Again as heLen
says this is not a programming related list.
// Setup the parameters
IBQuery1.SQL.Text := 'Insert into MyTest Values(:ImageFile)'; //....
replace with your sql
IBQuery1.ParamByName('Image').ParamType := ptInput;
IBQuery1.ParamByName('Image').DataType := ftBlob;
// setting the blob parameter in the procedure call is important
// even though it has already been defined
IBQuery1.ParamByName('Image').LoadFromFile(OpenPictureDialog1.FileName,
ftBlob);
// execute the query
IBQuery1.ExecSQL;
Regards
Martin.
At 07:17 PM 14/08/03 -0500, you wrote:
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/03
[Non-text portions of this message have been removed]
says this is not a programming related list.
// Setup the parameters
IBQuery1.SQL.Text := 'Insert into MyTest Values(:ImageFile)'; //....
replace with your sql
IBQuery1.ParamByName('Image').ParamType := ptInput;
IBQuery1.ParamByName('Image').DataType := ftBlob;
// setting the blob parameter in the procedure call is important
// even though it has already been defined
IBQuery1.ParamByName('Image').LoadFromFile(OpenPictureDialog1.FileName,
ftBlob);
// execute the query
IBQuery1.ExecSQL;
Regards
Martin.
At 07:17 PM 14/08/03 -0500, you wrote:
> > Hi All,----------
> >
> > I'm trying to store and retrieve graphics (Bitmaps and JPEGs)
> > to/from a BLOB field in one of my Firebird (1.5) Tables. I've looked
> > all over the place for the answer and the only ones I can find
> > involve TFields and TIBTables but I need to use a TIBQuery.
> >
> > I'm thinking along the lines of creating a Param and streaming the
> > graphic to/from it. Unfortunately I'm at a loss as to how to do it.
> >
> > Thanks for any help you can give me.
>
>As Helen says, this isn't a Delphi list. But, if you mention Firebird on the
>Delphi list, you will mainly get redirected here, as well. If my answer
>doesn't help enough, post this question in
>borland.public.delphi.interbaseexpress without mentioning Firebird.
>
>You need to utilize the streaming methods of the graphics components or a
>graphic file. Use a TIBBlobStream created with the CreateBlobStream method
>of the TIBQuery. Then, you can use the CopyFrom stream method to copy from
>one to the other.
>
>Woody (TMW)
>Freeware Page: http://users.eonet.net/woodytmw
>
>Success always occurs in private, and failure in full view.
>
>
>
>To unsubscribe from this group, send an email to:
>firebird-support-unsubscribe@yahoogroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>
>
>---
>Incoming mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/03
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.509 / Virus Database: 306 - Release Date: 12/08/03
[Non-text portions of this message have been removed]