🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.database.ado
Article #1518

Re: Using OR in a filter condition

#1518
From: Daryl
Date: Tue, 04 May 2004 10:14
21 lines
1474 bytes
Nigel
The examples I have seen use brackets, perhaps operator precedence is the
problem, what is the error that is thrown?

Perhaps try  ADOTable1->Filter="(LastName = 'Nigel') OR (Age > 10)";   //
May need spaces as well??

May also pay to use QuotedStr() to handle names with an apostrophe in them
i.e. O'Sing

Daryl


> Everytime I use OR in a filter condiiton on an ADO table it returns an
> error.  When I us AND everything works as it should.
>
> Example
>
> ADOTable1->Filter="LastName='Nigel' AND Age>10";  //Works fine
> ADOTable1->Filter="LastName='Nigel' OR Age>10";  //Throws an error
>
Technical Details
Message-ID: <40976daa@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <4096839d@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10698b,22e91307ad67c8d7
X-Google-Attributes: gid10698b,public
From: "Daryl" <stockd@tpg.com.au>
Newsgroups: borland.public.cppbuilder.database.ado
References: <4096839d@newsgroups.borland.com>
Subject: Re: Using OR in a filter condition
Date: Tue, 4 May 2004 20:14:13 +1000
Lines: 23
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
NNTP-Posting-Host: 202.7.180.89
Message-ID: <40976daa@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1083665834 202.7.180.89 (4 May 2004 03:17:14 -0700)
Path: arc1-ca.pugleaf.net!controlnews3.google.com!news2.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail