Subject Re: [IBO] preparing query
Author Helen Borrie (TeamIBO)
At 11:01 AM 23-04-02 -0300, you wrote:
>I can't put on the onprepared event because the query is open and I want to
>apply the sqlwhereitems after the user perform a buttonclick. My statments
>is created automatically according the user choose the options in the

Sorry, but you can't do that. SQLWhereItems actually changes the
specifications of the query: you use it to change columns of the selection
criteria. That causes the query to get unprepared. Therefore,
OnPrepareSQL is the *only* place where you can alter SQLWhereItems.

If you only want to change the values of existing parameters, then don't
use SQLWhereItems - it is not what you want. Use ParamByName() or Params[]
in the BeforeOpen event. In this case, if the query is already prepared,
it doesn't need to be prepared again...ParamByName() will do a Prepare if
one is needed but you must always call Prepare before calling Params[].

Helen Borrie (TeamIBO Support)

** Please don't email your support questions privately **
Ask on the list and everyone benefits
Don't forget the IB Objects online FAQ - link from any page at