Subject | Re: [IBO] TIB_DSQL and Active |
---|---|
Author | clivewalden |
Post date | 2006-04-28T01:29:33Z |
Here is a code snippet
======================
if not qryPhotoImg.Prepared then begin
qryPhotoImg.Prepare;
end;
qryPhotoImg.Params[0].Clear;
qryPhotoImg.Params[0].AsInteger := Key;
qryPhotoImg.Execute;
if qryPhotoImg.Active then begin
tmpStream := TMemoryStream.Create;
TIB_ColumnBlob(qryPhotoImg.FieldByName('IMG_PHOTO')).AssignTo(tmpStream);
aImgHolder.LoadImg(Key,'',tmpStream);
end;
========================
I want to be sure I have a BLOB before assigning it to a stream.
Clive.
======================
if not qryPhotoImg.Prepared then begin
qryPhotoImg.Prepare;
end;
qryPhotoImg.Params[0].Clear;
qryPhotoImg.Params[0].AsInteger := Key;
qryPhotoImg.Execute;
if qryPhotoImg.Active then begin
tmpStream := TMemoryStream.Create;
TIB_ColumnBlob(qryPhotoImg.FieldByName('IMG_PHOTO')).AssignTo(tmpStream);
aImgHolder.LoadImg(Key,'',tmpStream);
end;
========================
I want to be sure I have a BLOB before assigning it to a stream.
Clive.
--- In IBObjects@yahoogroups.com, Helen Borrie <helebor@...> wrote:
>
> At 10:51 AM 28/04/2006, you wrote:
> >Helen,
> >
> >Thank you for the prompt response.
> >
> >If Active is not relevant (Does not work as described in the help
> >file)
>
> I didn't say Active was not relevant. I said "making it not active"
> was not relevant.
>
> >then how should I test that the query actually returned data
> >before trying to access it?
>
> Read the Fields[] array after calling Execute.
>
> An example of what you're trying to achieve would be helpful.
>
> Helen
>