Subject Re: [IBO] Problem with TIB_Query.RecordCount
Author Jason Wharton
This appears to be due to an InterBase problem that somehow is being
triggered up.
Please develop this into a simple as possible sample app isolating this
problem.
It could be of use to the Firebird and InterBase teams.

Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com

-- We may not have it all together --
-- But together we have it all --


----- Original Message -----
From: "Thomas Steinmaurer" <ts@...>
To: "IBObjects" <IBObjects@yahoogroups.com>
Sent: Wednesday, October 23, 2002 2:10 PM
Subject: [IBO] Problem with TIB_Query.RecordCount


> Hello,
>
> I have encountered a problem using TIB_Query.RecordCount
> with a combination of Parametrized TIB_Query, OrderingItemNo <> 0
> and using HDR. I'm using IBO 4.2.Hj
>
> The select statement of the query looks like:
>
> SELECT *
> FROM IBLM$COLUMNLOG
> where logtable_id=:logtable_id
>
> OrderingItems:
>
> ID=ID;ID DESC
> LOGTABLE_ID=LOGTABLE_ID;LOGTABLE_ID DESC
> SPALTE=SPALTE;SPALTE DESC
> ALTERWERT=ALTERWERT;ALTERWERT DESC
> NEUERWERT=NEUERWERT;NEUERWERT DESC
>
> OrderingLinks:
>
> ID=ITEM=1;POS=0
> LOGTABLE_ID=ITEM=2;POS=0
> SPALTE=ITEM=3;POS=0
> ALTERWERT=ITEM=4;POS=0
> NEUERWERT=ITEM=5;POS=0
>
>
> For test purposes I've placed a button on a form with the
> following OnClick event handler.
>
> procedure TForm1.Button1Click(Sender: TObject);
> begin
> IB_Query1.Close;
> IB_Query1.ParamByName('logtable_id').Value := 1000;
> IB_Query1.Open;
> IB_Query1.OrderingItemNo := 1;
> ShowMessage(IntToStr(IB_Query1.RecordCount)); <---- error with
RecordCount
> end;
>
> The following exception is thrown:
>
> ISC ERROR MESSAGE:
> Dynamic SQL Error
> SQL error code = -804
> SQLDA missing or incorrect version, or incorrect number/type of variables
>
>
> The error is only raised when OrderingItemNo is not equal 0
> and when HDR is enabled.
>
>
> The callstack might be useful too:
>
> TIB_SessionBase.HandleException($CB5AA8)
> TIB_Statement.API_ExecImmed2(???,???,$CC0BBC)
> TIB_Statement.SysExecImmed2('SELECT COUNT( * )'#$D#$A'FROM
IBLM$COLUMNLOG'#$D#$A'where logtable_id=? /* logtable_id
> */',$CC1120,$CC0BBC)
> TIB_Dataset.SysGetCursorRecordCount
> TIB_BDataset.SysGetCursorRecordCount
> TIB_Dataset.SysRecordCount
> TIB_BDataset.SysRecordCount
> TIB_Dataset.RecordCount
> TForm1.Button1Click(???)
> Project1
>
>
> Any comments/hints? Thank you!
>
>
> Regards,
> Thomas Steinmaurer
> IB LogManager 2.1 - The Logging/Auditing Tool for InterBase and Firebird
> http://www.iblogmanager.com