Date: Thu, 21 Jun 2001 15:51:33 +0100 Newsgroups: borland.public.delphi.graphics Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Newsreader: Virtual Access by Atlantic Coast PLC, http://www.atlantic-coast.com/va Message-ID: Subject: Re: JPG, JPEG to BLOB From: Bob Villiers Reply-To: bob_villiers@lineone.net References: <3b310979$1_2@dnews> <3b313cf7$1_2@dnews> NNTP-Posting-Host: 62.6.100.5 X-Trace: dnews 993134971 62.6.100.5 (21 Jun 2001 07:49:31 -0700) Lines: 33 Path: dnews Xref: dnews borland.public.delphi.graphics:39960 Problem solved. //Load jpeg in file to blob field using SQL procedure TForm1.Button1Click(Sender: TObject); var ms: TMemoryStream; begin if OpenPictureDialog1.Execute then begin ms:= TMemoryStream.Create; try ms.LoadFromFile(OpenPictureDialog1.Filename); with Query1 do begin with SQL do begin Clear; Add('INSERT INTO "ImageTbl.db" (ImageFld)'); Add('VALUES (:param0 )'); end; Query1.ParamByName('param0').SetBlobData(ms.Memory, ms.Size); ExecSQL; end; finally ms.Free; end; end; end; Bob