|Subject||Re: [IBO] TIBOQuery, Locate, Order By|
--- In IBObjects@yahoogroups.com, Lester Caine <lester@l...> wrote:
> asbjorn_fridberg wrote:experiencing
> > Using a TIBOQuery (IBO Version 4.5.Ai, Delphi 7) I am
> > the following problem:Locate
> > When the querys' SQL includes an 'ORDER BY' statement, I get an
> > error when trying to Locate a record in the query, with the
> > (const KeyFields: string; const KeyValues: Variant; Options:= -
> > TLocateOptions) function.
> > I get the following error: '....Dynamic SQL Error SQL error code
> > 104 Token unknown - line 3 char 18 WHERE....' However, there isthen
> > no 'where' in my sql statement, and the problem disappears if I
> > erase the 'ORDER BY' clause from the querys' sql. I have worked
> > around
> > this by dynamically changing the sql before doing a locate, and
> > changing it back again, but I would appreciate if anyone has aget
> > suggestion as to what the problem is, and/or how to solve it.
> The problem you have is that IBO implements a lot of facilities by
> modifying the SQL. For example, using a WHERE field = 'locate' to
> the right value. Since your SQL does not have it's own WHERE, IBOadds
> it, and that is after the ORDER BY. All you need is a clean WHEREclause
> that IBO can modify, even if it does not actually filter theresults.
> The WHERE clause is also modified to handle the selectivefiltering and
> things like that.Thank you for the quick reply Lester, that worked perfectly!
> Lester Caine
> L.S.Caine Electronic Services