Re: Filter Recordset
From: Bob Barrows [MVP] (reb01501_at_NOyahoo.SPAMcom)
Date: 07/13/04
- Next message: Jim Gregg: "Windows 98 Computer Name"
- Previous message: Bob Barrows [MVP]: "Re: Calling Sp in Vbscript"
- In reply to: Julio: "Filter Recordset"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 13 Jul 2004 13:43:25 -0400
Julio wrote:
> Hi,
> I am trying to filter a recordset using a condition like this:
> (fld1 LIKE '*epo*' Or fld2 LIKE '*epo*' Or fld3 LIKE '*epo*' Or fld4
> LIKE '*epo*' Or fld5 LIKE '*epo*' Or fld6 LIKE '*epo*') And (fld7 =
> 28)
>
> This is the error that i receive:
> ADODB.Recordset error '800a0bb9'
> Arguments are of the wrong type, are out of acceptable range, or are
> in conflict with one another.
>
> If i execute the part with ORs everything is ok as if i execute the
> part of the condition with AND.
>
> Any idea
> Thanks in advance
> Julio
>From online help:
a.. 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'a..
Instead, you would construct this filter as
(LastName = 'Smith' AND FirstName = 'John') OR (LastName = 'Jones' AND
FirstName = 'John')HTH,
Bob Barrows
-- Microsoft MVP -- ASP/ASP.NET Please reply to the newsgroup. The email account listed in my From header is my spam trap, so I don't check it very often. You will get a quicker response by posting to the newsgroup.
- Next message: Jim Gregg: "Windows 98 Computer Name"
- Previous message: Bob Barrows [MVP]: "Re: Calling Sp in Vbscript"
- In reply to: Julio: "Filter Recordset"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|