Hi everyone,
I have solved the problem and my application CAN now handle either JPEG or BitMap Blobs in the same column, without having to use a column storing the image type, and without having to decipher the image type from the Blob data.
The solution is as follows, using Except coding:
// var
// BlobField: TField;
// BS: TStream;
with SQLQuery1 do
begin
BlobField := FieldByName('Pic'); {'Pic' is name of column with photo}
BS := CreateBlobStream(BlobField,bmRead);
Image1.Picture.Graphic:= TJpegImage.Create; {assume is Jpeg}
Try
Image1.Picture.Graphic.LoadFromStream(BS); {error if not Jpeg}
Except {repeat steps for BitMap}
BS.Free;
Image1.Picture.Graphic:= nil; {empty}
BlobField := FieldByName('Pic'); {'Pic' is name of column with photo}
BS := CreateBlobStream(BlobField,bmRead);
Image1.Picture.Graphic:= TBitMap.Create; {bitmap}
Image1.Picture.Graphic.LoadFromStream(BS);
end; {Try}
BS.Free;
end; {with SQLQuery}
Thanks everyone for helping out!