Subject Re: [IBO] Problem with TIBOQuery
Author Hans
Thank you Helen,

I'm not about to rewrite some QReport functions yet :)

But I did trace it down and found some solution.

Open the Queries used in the QReport, go Query.Last
then Query.First. This sets the flags 'Bof and Eof seen
in the internal IBO buffers and the momentary RecordCount
seems to be correct or at least usuable. QReport is happy now..

Just trying to convert the BDE/BDISam version of BS1,
a well established accounting package used in more
than 70 countries as they advertise.

Best Regards
Hans

----- Original Message -----
From: "Helen Borrie" <helebor@...>
To: <IBObjects@yahoogroups.com>
Sent: Tuesday, February 01, 2005 4:13 PM
Subject: Re: [IBO] Problem with TIBOQuery


>
> At 02:56 PM 1/02/2005 -0700, you wrote:
>
>>Hello,
>>
>>Version 4.5Ai
>>
>>Select * from Table1
>>where condition1
>>order by 1,2,3
>>
>>TIBOQuery.RecordCount returns correct value
>>
>>However
>>
>>Select * from Table1
>>where condition1
>>union
>>Select * from Table1
>>where condition2
>>order by 1,2,3
>>
>>TIBOQuery.RecordCount aborts and raises exception
>>
>>ISC ERROR CODE:335544569
>>SQL error code = -104
>>Invalid command
>>count of column list and variable list do not match
>>
>>The RecodCount call is generated by QReport in Page x of y calculations
>>
>>What is the solution, if any ?
>
> None that I know of. Fb/Ib currently doesn't return a RecordCount from
> selects. If you ask for one, IBO will (ultimately) try to get one by
> attempting to manufacture a SELECT COUNT(*) query internally from the SQL
> statement. However, SELECT COUNT(*) queries are not valid for unioned
> sets, so there isn't a valid RecordCount query that could be constructed.
>
> In a very awkward way, you could try to calculate a record count in a
> routine of your own, by a series of queries. I wouldn't recommend it,
> though.
>
> Helen
>
>
>
>
>
> ___________________________________________________________________________
> IB Objects - direct, complete, custom connectivity to Firebird or
> InterBase
> without the need for BDE, ODBC or any other layer.
> ___________________________________________________________________________
> http://www.ibobjects.com - your IBO community resource for Tech Info
> papers,
> keyword-searchable FAQ, community code contributions and more !
> Yahoo! Groups Links
>
>
>
>
>
>
>