Subject Re: [IBO] Problem with TIBOQuery
Author Helen Borrie
At 08:57 AM 20-12-01 -0200, Helton de Oliveira wrote:
>I'm porting a BDE application to IBO using the TIBO components and i'm
>having problems with a TIBOQuery with a SmallInt parameter called "MES".
>The TIBOQuery didn't find any data. It seems not respect the parameter since
>there is data in the table especified on the Select clause which conforms
>with "MES=12".
>Here is the select clause: "SELECT * FROM VctosDescs WHERE Mes = :Mes ORDER
>BY Mes, CodVctoDesc"

Change this to omit Mes from the order by criteria - it's not logical to order a set by a column that cannot possibly have more than one value.

>Here is the BeforeOpen event of the TIBOQuery:
>procedure TdtmTables.qryVctDscBeforeOpen(DataSet: TDataSet);
> //qryVctDsc.ParamByName('Mes').AsInteger := 12;


>Here is the AfterOpen event of the TIBOQuery:
>procedure TdtmTables.qryVctDscAfterOpen(DataSet: TDataSet);

with Dataset do begin

> //if (qryVctDsc.BOF and qryVctDsc.EOF) then DoSomething;
> //qryVctDsc.First;

if IsEmpty then

Just make these changes and check whether you are still getting an empty dataset.