Board index » delphi » "Blob has invalid header" error message

"Blob has invalid header" error message

I am using the following code to insert a .bmp graphic image into a Paradox
Table. The code works. However, when I try and view the image in the Paradox
table, from within paradox, it does not show and it gives an error message,
"Blob has invalid header." Conversely, if I create a form within Delphi,
with a table data source and graphic image, I can see the .bmp graphic that
I inserted. Delphi can view the graphic, but Paradox cannot.

Does anybody know why this is happening, and how I can get Paradox to
display the image properly?

var

patientpic :  TBitMap;
myblobstream : tblobstream;

begin
    patientpic := TBitMap.Create;
    session1.addpassword('filepop');
    patientpic.loadfromfile('c:\demo.bmp');
    PatientTbl.open;     // a table on the form
    PatientTbl.edit;
    myblobStream :=
        TBlobStream.Create(TblobField(patienttbl.FieldByName('Patient
picture')), BmWrite);
    showmessage('myblbostream created');
    patientpic.SaveToStream(myblobstream);
    showmessage('the graphic was saved to steam');
    PatientTbl.post;
    patienttbl.close;
    showmessage('the tables were closed');
    patientpic.free;

end;

 

Re:"Blob has invalid header" error message


Use TGraphicField and Assign()

Other Threads