I want to check whether given row at a time contains image at BLOB field
I m using following code but it is not working properly, as it enters into the if loop even if there is no image at BLOB field.
Code: Select all
if Assigned(UniTable1.FieldByName('image')) then
begin
//showmessagefmt('ID Value Inititally :- %d',[k]);
Stream2[k] := TMemoryStream.Create;
Stream2[k] := UniTable1.CreateBlobStream(TBlobField(UniTable1.FieldByName('image')), bmRead);
end;
Code: Select all
if UniTable1.FieldByName('image').ToString <> '' then
begin
//showmessagefmt('ID Value Inititally :- %d',[k]);
Stream2[k] := TMemoryStream.Create;
Stream2[k] := UniTable1.CreateBlobStream(TBlobField(UniTable1.FieldByName('image')), bmRead);
end;