Subject Problem with SearchPanel : Index exceeds maximum
Author Werner Hofmann
Using Delphi 7E, IBO 4.2I


The query :

SELECT A.NAME
, A.VORNAME
, A.PLZ
, A.ORT
, A.STRASSE
, P.*
, (select vt.Name from VERTRETER_VIEW vt
where vt.VertreterKey=p.VertreterKey) as VName
, (select u.UstProzent from UST u
where u.UstKey=p.UstKey) as UstProzent
, (select kn.Name from Konzern_VIEW kn
where kn.KonzernKey=p.KonzernKey) as KName
, (select po.Beschreibung from Post po
where po.PostKey=p.PostKey) as Post
, (select w.WaehrungLang from Waehrung w
where w.WaehrungKey=p.WaehrungKey) as Waehrung
, (select sp.Sprache from Sprache sp
where sp.Sprachkey=p.Sprachkey) as Sprache
, (select pt.PartnerText from PartnerTyp pt
where pt.PartnerTypKey=p.PartnerTypKey) as PartnerTyp
, (select za.Zahlungsart from ZahlungsArt za
where za.ZahlungsArtKey=p.ZahlungsArtKey) as ZahlungsArt
, (select va.VersandArt from VersandArt va
where va.VersandArtKey=p.VersandArtKey) as VersandArt
FROM ADRESSEN A
INNER JOIN PARTNER P ON (A.ADRESSKEY = P.RECHNUNGADRESSKEY)
where (P.PartnertypKey =:PTyp)and(name starting with :Name)
order By name

has a result of 44 Columns.
I have an IB_Searchpanel where i can select a value for Vt.Name.
If i execute the searchpanel i get an 'exception index value exceeds the
maximum(39)'.

The (39) seems to be the Columnnumber of Field(vt.Name) in the query.
During debugging of the procedure ExtractWhereClause in Unit IB_Parse,
I see that the property IB_Field.Count = 15.
The statement IB_Field.Statement.sysfields[FieldNo] causes the error.

if i move the subselect for the VT.Name that it becomes a Columnnumber < 15
all works fine.
Is this a bug ??

best regards
Werner Hofmann