BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Filter error... but why?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO)
View previous topic :: View next topic  
Author Message
Mike Niemann
Guest





PostPosted: Tue Aug 23, 2005 3:45 pm    Post subject: Filter error... but why? Reply with quote



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


Back to top
Viatcheslav V. Vassiliev
Guest





PostPosted: Tue Aug 23, 2005 6:49 pm    Post subject: Re: Filter error... but why? Reply with quote



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 (AT) oowidgets (DOT) com> сообщил/сообщила в новостях
следующее: news:430b447c (AT) newsgroups (DOT) borland.com...
Quote:
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





Back to top
Mike Niemann
Guest





PostPosted: Thu Aug 25, 2005 1:58 am    Post subject: Re: Filter error... but why? Reply with quote



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 (AT) oledbdirect (DOT) com> wrote:

Quote:
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 (AT) oowidgets (DOT) com> сообщил/сообщила в новостях
следующее: news:430b447c (AT) newsgroups (DOT) borland.com...
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




Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Databases (ADO) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.