Re: Filterproblem with ADOQuery while mixing AND & OR operators
- From: "Victor Snezhko" <snezhko@xxxxxxxxxxxx>
- Date: 24 Oct 2005 03:11:15 -0700
Mani wrote:
> I try to set a filter on my ADOQuery like this:
> (Name='John' OR Firstname='John') AND Birthdate>'2005-01-01'
> When i do this, there comes up an EOleException which tells me that the
> arguments are from the wrong type.
> Following is working fine:
>
> Name='John' OR Firstname='John') OR Birthdate>'2005-01-01'
>
> and this also:
>
> (Name='John' AND Firstname='John') AND Birthdate>'2005-01-01'
>
> It seems that Delphi has a problem in mixing AND & OR Operators in the
> filter.
Not Delphi but ADO itself.
You can always rewrite your filter expression to the one that will
work.
e.g. (Name='John' AND BirthDate > '2005-01-01') OR (Firstname='John'
AND Birthdate > '2005-01-01')
See Microsoft's Q235892 for details.
.
- References:
- Prev by Date: Re: Non-skipping IDs with Master-Detail
- Next by Date: Re: changing a Clinet/Server application to use connection pooling
- Previous by thread: Re: Filterproblem with ADOQuery while mixing AND & OR operators
- Next by thread: Hide access password
- Index(es):
Relevant Pages
|