Subject RE: [IBO] Any progress yet on the IBO 4.6Bc bug with Parsing of Joins when using FB2.0?
Author Jason Wharton
Adrian wrote:
> I tried the following Query in code, in my application, and still
> getting the error.
>
> The following code snippet, may indicate what is causing the error:

procedure TFormAnimalInfo.AnimalLookup(Gender, sID: String);
begin
If Gender = 'M' Then
begin
with FormAnimalLookup.IB_QueryLookupAnimals do
begin
Close;
SQL.Clear;
SQL.Add('SELECT A.ANIMALIDENTIFICATION, A.ANIMALNAME,');
SQL.Add('A.ANIMALREGIST RATIONNUMBER, A.ANIMALHERDSTATUS,
A.ANIMALDOB,');
SQL.Add('A.ANIMALGENDER, A.ANIMALTAGCOLOUR, A.ANIMALID,');
SQL.Add('S.ANIMALSIRESTATUS, S.ANIMALFIRSTSIREDATE');
SQL.Add('FROM ANIMAL A, ANIMALACTIVESIRES S');
SQL.Add('where (A.ANIMALID = S.ANIMALSIREID) AND');
SQL.Add('(A.ANIMALGENDE R = ''' + Gender + ''')');
SQL.Add('ORDER BY A.ANIMALIDENTIFICATION');
Prepare;
Open;
IF sID <> '' then // Don't search if no value.
Locate('ANIMALIDENTIFICATION',sID,[]);
end;
end;
...
end;

> I get error on prepare: Field
> ANIMALACTIVESIRES.ANIMALSIRESTATUS not found.

This should be easy enough to reproduce.

I'll have a look at it.

Jason Wharton