Using .FILTER

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have a JET table that I'm trying to access through Visual Basic 6 using ADO.
I'm trying to filter the table looking for only certain Product Lines

1. I run the following code and it filters the correct records for me

Q = "(Key = 1)"

Rsts(6).Filter = IIf(Q = "", adFilterNone, Q)

2. When I run the following code it only filters the same as above as if
was
(Key = 2)

Q = "((Key = 1) or (Key = 2))"

Rsts(6).Filter = IIf(Q = "", adFilterNone, Q)

*** Does anyone have any idea what I'm doing wrong ????

3. I then tried the following code and I got a 3001 error message ... The
IN
statement worked in MS Access SQL but I can't seem to find any
reference to
it in ADO

Q = "(Key IN (1,2))"

Rsts(6).Filter = IIf(Q = "", adFilterNone, Q)

*** Is the IN Statement supported in normal SQL (ADO) or has the
command
changed?

I must be doing somthing wrong, but I don't know what. Can anyone show me
the errors of my way?????

Thanks in advance

--
George H. Slamowitz
(602) 765-8111
(602) 765-8222 (FAX)
.



Relevant Pages

  • Speed improvements for cyclic data processing and transformation tasks
    ... I am trying to refine some ADO code that is used to extract data from ... excel spreadsheets and do a simple ETL type process to place the data ... I was thinking of using filters ... to reduce the size of the loops, but maybe there is even a better way. ...
    (comp.databases.ms-access)
  • RE: Lotus Approach database into excel
    ... Are there any filters in ODBC? ... Is your question about ADO? ... If so please post in the corresponding newsgroup. ...
    (microsoft.public.data.odbc)
  • Re: Return a single value from a Sybase stored procedure using ADO
    ... proper value but I get error on the ADO call. ... The error message appears at the "While Not" line ... Dim objConn As Object ... Dim objRs As Object ...
    (microsoft.public.vb.database.ado)
  • Re: Really need help! ADO not working
    ... Set cnn = CurrentProject.Connection ... I'm guessing the error message doesn't say, ... See http://www.Access.QBuilt.com for Microsoft Access tips and tutorials. ... ' Microsoft ADO Ext. 2.8 for DDL and Security ...
    (microsoft.public.access.modulesdaovba)
  • Re: Text Converter
    ... but not getting an error message when you try is certainly better. ... The filters themselves are stored in the folder: ... installation says that the WP filter is installed then uninstall it and ... but the converter pack didn't work. ...
    (microsoft.public.word.docmanagement)