Subject Re: [IBO] TIBOQuery, Locate, Order By
Author asbjorn_fridberg
--- In, Lester Caine <lester@l...> wrote:
> asbjorn_fridberg wrote:
> > Using a TIBOQuery (IBO Version 4.5.Ai, Delphi 7) I am
> > the following problem:
> > 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 is
> > 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 a
> > 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, IBO
> it, and that is after the ORDER BY. All you need is a clean WHERE
> that IBO can modify, even if it does not actually filter the
> The WHERE clause is also modified to handle the selective
filtering and
> things like that.
> --
> Lester Caine
> -----------------------------
> L.S.Caine Electronic Services

Thank you for the quick reply Lester, that worked perfectly!

Asbjørn Fridberg