Subject | Re: OnCalculateField: writing to calculated field of type blob throws AV |
---|---|
Author | sonic3076 |
Post date | 2009-03-06T15:12:44Z |
Is it possible that you have set CalculateAllFields = true?
Then you get an AV if you try to access AField.
Then you get an AV if you try to access AField.
--- In IBObjects@yahoogroups.com, Markus Ostenried <macnoz@...> wrote:
>
> Hi all,
>
> I have a TIB_Query with SQL
> select * from rdb$database
>
> Then I declared a calculated field like this:
> blob_calc blob sub_type 0
>
> procedure TForm1.IB_Query1CalculateField(Sender: TIB_Statement; ARow: TIB_Row;
> AField: TIB_Column);
> begin
> if SameText(AField.FieldName, 'blob_calc') then
> AField.Assign(TStringStream.Create('abc')); // <- AV here
> end;
>
> When I open the query I get an AV in ClearBlobNodeData.
>
> Callstack follows:
>
> IB_Session.pas | | ClearBlobNodeData
> IB_Session.pas | | ClearBlobNodeData
> IB_Components.pas | TIB_BlobStream | Initialize
> IB_Components.pas | TIB_BlobStream | Initialize
> IB_Components.pas | TIB_BlobStream | Create
> IB_Components.pas | TIB_BlobStream | CreateForColumn
> IB_Components.pas | TIB_BlobStream | CreateForColumn
> IB_Components.pas | TIB_Statement | CreateBlobStream
> IB_Components.pas | TIB_Statement | CreateBlobStream
> IB_Components.pas | TIB_ColumnBlob | LoadFromStream
> IB_Components.pas | TIB_ColumnBlob | LoadFromStream
> IB_Components.pas | TIB_ColumnBlob | Assign
> Unit1.pas | TForm1 | IB_Query1CalculateField
>
> Using IBO 4.8.7 and D2007.
>
> Question is: Is this a known limitation or am I doing something wrong here?
>
> I'm using the calculated blob because I select compressed bitmap
> images from the database and need to present them to ReportBuilder as
> blobs containing uncompressed images.
>
> TIA,
> Markus
>