Article View: borland.public.cppbuilder.database.ado
Article #3691Re: Does this code work on ADO?
From: Mark Guerrieri
Date: Sun, 07 Jul 2002 15:06
Date: Sun, 07 Jul 2002 15:06
43 lines
2219 bytes
2219 bytes
No, it cannot. The MS docs for the ADO Filter property state the following: 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') Mark Guerrieri CTO Creative Marketing Strategies mguerrieri@cmsgrp.com "Baris YURTCU" <badidi@hotmail.com> wrote in message news:3d278297_2@dnews... > Hi, > > My record set object is dataset1. DB is MS-SQL server. > > dataset1.Filter = "Age <= 18 AND (Age = NULL OR Age >= 30)" // First Code > > This code doesn't work. But these codes work: > > dataset1.Filter = "(Age = NULL OR Age >= 30)" // Second Code > > dataset1.Filter = "Age <= 18 AND (Age = NULL AND Age >= 30)" // Third Code > > Change is only OR on third code according to first code. I have changed OR > to AND. (Condition is nonsensical, but that's not important) Second code > works fine. > > What this does mean? Can not ADO analyze "(<Condition1> AND <Condition2> > (<Condition3> OR <Condition4>)" style Filter? > > Thanks, > Baris > >
Technical Details
Message-ID:
<3d2858fb$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!feed.textport.net!news.stealth.net!news.stealth.net!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!dnewsReferences:
<3d278297_2@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10698b,22e3398c1868196 X-Google-Attributes: gid10698b,public X-Google-ArrivalTime: 2002-07-07 08:10:07 PST From: "Mark Guerrieri" <markg11@comcast.net> Newsgroups: borland.public.cppbuilder.database.ado References: <3d278297_2@dnews> Subject: Re: Does this code work on ADO? Date: Sun, 7 Jul 2002 11:06:37 -0400 Lines: 45 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 68.44.67.205 Message-ID: <3d2858fb$1_1@dnews> X-Trace: dnews 1026054395 68.44.67.205 (7 Jul 2002 08:06:35 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-01!supernews.com!feed.textport.net!news.stealth.net!news.stealth.net!eusc.inter.net!newsfeed01.sul.t-online.de!t-online.de!dnews