EAccessViolation in a SaveToStream procedure

Hi
I'm trying to show a TBlobField in an TImage.
Following the advices you gave in others topics i did this:

procedure TForm1.Button1Click(Sender: TObject);
var
oStream : TBlobStream;
begin
oStream := nil;
try
OracleDataSet1IMAGEN.SaveToStream(oStream);
Image1.Picture.Bitmap.LoadFromStream(oStream);
finally
oStream.Free;
end;
end;

I got an EaccessViolation error because the oStream object is not instantiated, but when i tried to do it with the sentence:
oStream := TBlobStream.Create(OracleDataSet1IMAGEN, bmRead);
i get the EinvelidCast error

Someone can tell me what i'm doing wrong?
Thanks
 
The TBlobStream.Create constructor implicitly assumes a BDE dataset. The TOracleDataSet descends from the TDataSet class though, and this causes the error.

Therefore you cannot use a TBlobStream here.
 
Back
Top