Subject Re: [IBO] Strange SQL results with large text field
Author Helen Borrie
At 01:05 PM 7/04/2008, you wrote:
>Hi
>
>I have an SQL which i run on a FB DB using a TIBOQuery. The Query has a
>Datasource attached which an TADOQuery connects to. The TADOQuery has
>an Insert query that takes the resulting fields and inserts them into a
>'foreign' DB. I loop through the TIBOQuery and run the TADOQuery
>insert once ofr each record. This is a data export tool.
>
>This has worked fine for years but we have recently discovered an issue
>(that may be related to us upgrading our version of IBObjects). On some
>fields the TIBOQuery shows results when there are none. i.e.
>
>on one record Stock0015 should be Null however
>FieldByName('Stock0015').AsString lists lots of text (from another prior
>record maybe 100 records prior), however FieldByName('Stock0015').IsNull
>correctly returns True.
>
>The field in question is a VarChar(2048).
>
>If I refresh the query the values are then correct.
>If I run the query in an SQL tool they also show correctly (including a
>tool written with TIBO components).
>
>What can I do?

Well, the place to start would be to look at the code where you pick up the text from the current IBODataset row to pass it to the ADOQuery parameter. Of special interest would be whether you are relying on some record number property that isn't valid for an IBO set...or where you might be treating null and empty string somewhere as though they were equivalent.

Helen