Re: Filter error... but why?



Viatcheslav,

Thank you for the info... hard to believe that ADO can have such a
major limitation... but apparently it does.

Regards, Mike Niemann

On Tue, 23 Aug 2005 22:49:54 +0400, "Viatcheslav V. Vassiliev"
<support@xxxxxxxxxxxxxxx> wrote:

>ADO does not support filters in form A AND (B OR C). Instead you should
>write (A AND B) OR (A AND C). This is from MSDN:
>
>There is no precedence between AND and OR. Clauses can be grouped within
>parentheses. However, you cannot group clauses joined by an OR and then join
>the group to another clause with an AND, like this:
>(LastName = 'Smith' OR LastName = 'Jones') AND FirstName = 'John'
>Instead, you would construct this filter as
>(LastName = 'Smith' AND FirstName = 'John') OR (LastName = 'Jones' AND
>FirstName = 'John')
>
>//------------------------------------------
>Regards,
>Vassiliev V. V.
>http://www.managed-vcl.com - using .Net objects in Delphi for Win32 +
>ADO.Net
>http://www.oledbdirect.com - The fastest way to access MS SQL Server,
>MS Jet (Access) and Interbase (through OLEDB)
>
>
>"Mike Niemann" <mniemann@xxxxxxxxxxxxx> ÓÏÏÂÝÉÌ/ÓÏÏÂÝÉÌÁ × ÎÏ×ÏÓÔÑÈ
>ÓÌÅÄÕÀÝÅÅ: news:430b447c@xxxxxxxxxxxxxxxxxxxxxxxxx
>> TDataset filtering... filter looks good, why the exception?
>>
>> Filter - ( ([LastName] like 'm%')) AND (IdNumber = '333-33-1111' or
>> IdNumber
>> = '333-33-1112' or IdNumber = '333-33-1113' or IdNumber = '333-33-1114' or
>> IdNumber = '333-33-1115')
>>
>> Exception - Arguments are of the wrong type, are out os acceptable range,
>> or
>> are in conflict with one another.
>>
>> Regards, Mike Niemann
>>
>>
>
.



Relevant Pages

  • Re: Sum only visible cells
    ... In Excel 2003, subtotal has options to ignore any hidden row - not just ... those rows hidden by a filter. ... Regards, ...
    (microsoft.public.excel.programming)
  • Re: Search and display multiple records
    ... if you design view the subform on it's own, and go to the properties of the ... Regards ... >> Alex White MCDBA MCSE ... >>> I just found this code in some other forum that allow me to filter the ...
    (microsoft.public.access.formscoding)
  • Re: New to Access, need direction and help. Access 2002
    ... >> relational design before you go a step further - as it is, ... I would like to track the filter usage at each site and the ... >>> Regards, ... >>> Drew ...
    (microsoft.public.access.gettingstarted)
  • Re: [Current User] filter problem
    ... >>filter to the web part. ... >>security group in Active Directory. ... >>Best regards, ... >>Stefan Nilsson ...
    (microsoft.public.sharepoint.windowsservices)
  • Re: ColdFusion
    ... adocst.axes.item(it's in ColdFusion syntax). ... > the ADO for Multidimensional Objects driver instead of ADO. ... >> I've tried adding the datasource under SQL Server but am getting the ... >> Regards, ...
    (microsoft.public.sqlserver.olap)