Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Problems with ORACLE BLOB Fields and Delphi

Problems with ORACLE BLOB Fields and Delphi

From: Frank Geisler <plexicom_at_msn.com>
Date: Fri, 22 May 1998 18:54:52 +0200
Message-ID: <uy7FyEah9GA.205@uppubnews03>


Hello.
I have a problem with ORACLE 7.3.2.2.1 and Delphi 2.0 C/S. The connection between
client program and database server works fine. Now I have tried to store binary data
(e.g. images) in an ORACLE Blob Field. This seems to work. But when I try to load the
image from the database and store it on harddisk, the begining is missing. The rest of
the file is O.K. (I checked it with a Hex-Editor). Here is the code:



procedure TForm1.Save;                                        //Save image
into database
var
  Index : Integer;
begin
  Query1.Active := TRUE;
  Index := Query1Gfx_Nr.AsInteger;
  if Table1.FindKey([Index]) = TRUE then     begin
      Table1.Edit;
      Table1Gfx.LoadFromFile ('mypic.bmp');
      Table1.Post;

    end;
  Query1.Active := FALSE;
end;
procedure TForm1.Load;                                       //load image
from database
var
  Name : String;
  Index : Integer;
begin
  SaveDialog1.Execute;
  Name := SaveDialog1.FileName;
  Query1.Active := TRUE;
  Index := Query1Grafik_Nr.AsInteger;
  if Table1.FindKey([Index]) = TRUE then     begin
      Table1.Edit;
      Table1Gfx.SaveToFile(Name);
      Table1.Post;

    end;
  Query1.Active := FALSE;
end;


Table1Gfx is TBlobfield, Gfx exists in the table etc. Everything works, but the begining of the image is missing. Please mail me, if you can help and know anything about this phenomenon.

Thank you

Frank Geisler Received on Fri May 22 1998 - 11:54:52 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US