🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: ADO filter format AND invalide type

#1084
From: Viatcheslav V. Vassiliev
Date: Fri, 19 Nov 2004 11:22
44 lines
2441 bytes
You can not mix AND and OR this way. 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)

"Jonathan Dumaresq" <jdumaresq@cimeq.qc.ca_nospam> �������/�������� �
�������� ���������: news:419d0030@newsgroups.borland.com...
> hi all,
>
> I just try to port my bde app to ado app.
>
> I have a problem with a filter that work on bde and now dosen't work and
> throw an exception.
>
> here the filter:
>
> filter = "[Date] >= '2004-11-18' AND [Date] < '2004-11-19' AND ([Local] =
> 'F102' OR [Local] = 'F103');
>
> If I only put AND  or OR between field no exeption are genereted. But if i
> mix both ..
>
> Arguments are incorrect type, out of authorized limit or in conflic.
>
>
> bcb6 sp4
> regards
>
> Jonathan
>
>
Technical Details
Message-ID: <419dd776@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <419d0030@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10698b,a366cc4bae75142
X-Google-Attributes: gid10698b,public
X-Google-Language: ENGLISH,ASCII
From: "Viatcheslav V. Vassiliev" <support@oledbdirect.com>
Newsgroups: borland.public.cppbuilder.database.ado
References: <419d0030@newsgroups.borland.com>
Subject: Re: ADO filter format AND invalide type
Date: Fri, 19 Nov 2004 14:22:26 +0300
Lines: 46
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1437
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441
NNTP-Posting-Host: 213.234.218.42
Message-ID: <419dd776@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1100863350 213.234.218.42 (19 Nov 2004 03:22:30 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!border2.nntp.ams.giganews.com!nntp.giganews.com!pe2.news.blueyonder.co.uk!blueyonder!news-peer-test!btnet!newsfeed.bt.es!caladan.landsraad.net!newsgroups.borland.com!not-for-mail