MySQL Forums
Forum List  »  Delphi

Re: Saving a Bitmap Image to a Blob
Posted by: Andrey Sokolov
Date: June 12, 2006 02:59AM

Martijn Tonies wrote:
> Actually, it's quite easy ;-)
>
> 1st: do not use TDBImage -> it doesn't support
> JPGs, use TImage instead
>
> 2nd: create a parameterized INSERT INTO statement
> and use LoadFromFile or LoadFromStream on the
> parameter
>
> 3rd: execute the statement.
>
> Bingo, that should be it!
>


I've similar problem with inserting file into BLOB. The file size is about 500k so i use mediumblob filed type.
Inserting:

Qry.SQL.Text:='INSERT INTO tbl_brcfile VALUES (:BrdKey, :Brc)';
Qry.Parameters.ParamByName('BrdKey').Value:=BrdKey;
Qry.Parameters.ParamByName('Brc').LoadFromFile(BrcFileName, ftBlob);
try
Qry.ExecSQL;

Qry has type TADOQuery.
The at the last string (ExecSQL) apears the exception "Connection was lost". The program really looses the coonection but then reconnects automatically. No data is inserted into the table. What shall i do?:( Help!

Options: ReplyQuote


Subject
Written By
Posted
March 28, 2006 09:23PM
April 01, 2006 09:01PM
Re: Saving a Bitmap Image to a Blob
June 12, 2006 02:59AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.