Board index » delphi » Invalid class typecast

Invalid class typecast

I have persistant field in ClientDataSet. Declaration in Form class is :

CDSPicturesPICTURE: TBlobField;

This is BLOB field in Oracle database. When I want to create BlobStream
using following code I always get error:

Invalid Class Typecast
........... a part of my code
Var
  LStrm: TBlobStream;
begin
  LStrm := TBlobStream.Create(CDSPicturesPicture, bmRead);

Can you help me with this ?
Thank you very much
Jaro

 

Re:Invalid class typecast


Quote
In article <3b61678d_2@dnews>, Jaro wrote:
> I have persistant field in ClientDataSet. Declaration in Form class is :

> CDSPicturesPICTURE: TBlobField;

> This is BLOB field in Oracle database. When I want to create BlobStream
> using following code I always get error:

> Invalid Class Typecast
> ............ a part of my code
> Var
>   LStrm: TBlobStream;
> begin
>   LStrm := TBlobStream.Create(CDSPicturesPicture, bmRead);

Use the datasets Createblobstream method instead of creating the stream
directly. Some Tdataset descendents require special descendents of
TBlobstream to work properly with BLOB fields. You don't need to worry
about that when you use the blobstream, just let the dataset create it for
you.

Peter Below (TeamB)  100113.1...@compuserve.com)
No e-mail responses, please, unless explicitly requested!
Note: I'm unable to visit the newsgroups every day at the moment,
so be patient if you don't get a reply immediately.

Other Threads