Subject Re: [IBO] TIBOQuery modify Order affects Params
Author Helen Borrie
At 03:38 AM 29/10/2003 +0000, you wrote:
>I am converting a number of BDE applications to IBO. Many of these
>apps modify the Query SQL strings "ORDER BY" clause dynamically in
>response to user input. The queries generally contain parameterised
>"WHERE" clauses.
>The problem I am having is that since converting to IBO the first
>"Open" of a query executes fine but after closing the query and
>modifying the "ORDER BY" clause dynamically, the second "Open" causes
>parameter problems such as "nn/nn/nn nn:nn:nn.nnnn is not a valid
>date and time".

This is a Delphi error, not a database one. Somehow your Date variable is
passing a string that Delphi can't parse as a valid date/time.

What version of IBO are you using? If it's a fairly old one, it could be a
problem with the way IBO used to parse date inputs -- long ago fixed.

Try to intercept Date and inspect what's being passed, before it gets to
the AsDateTime call. Delphi is very US-centric about data formats. Our
25/12/2003 isn't a valid date in Delphi.

You'll find better ways in IBO to manage the parameter swapping and
ordering, as well, though I don't think your current approach, though
hairy, is necessarily the cause of your current problem.