Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter works in Access2000 but not in Access2002 1

Status
Not open for further replies.

Rob892

Programmer
May 24, 2003
10
US
Any ideas on why the following filter for a recordset woks on my home computer using Access2000 but not on my work computer using Access2002?

rstBusGroupIn.Filter = "[ArrDay] = " & "'" & ArrOrder(i) & "'" & " And [AssignThisArrival] = 1 And [BellmanArrival] = 10"

I need to filter the recordset rstBusGroupsIn for groups that arrive on a certain day, which is held in an array ArrOrder, and the field AssignThisArrival is true, and the value for BellmanArrival is 10.
This filter is executed seven times as part of a loop that runs through the ArrOrder array, with actions taken for each days group arrivals. Thanks, Rob
 
1. Make sure both databases have the same field structures (field data types, etc).
2. Make sure both databases are Mdbs.
3. Make sure both machines use the same JET 4 version, and ADO OLEDB versions are at least version 2.5

(download the latest JET 4 SP from and the MDAC (at least version 2.5) for ADO from
5. Try using a client cursor and see with this test is the results are still different (if they are then your problem probably lies with an old version of ado on one of the machines)

6. Are you referencing ADO OLEDB or ADOR?

7. If these do not help, post what differences are you getting and the connection string and the non-default recordset properties you are setting in code.
 
Both DB's are exactly the same, except that the one at home uses Access2000. Here is the information :

Dim rstBusGroupIn As ADODB.Recordset
Set rstBusGroupIn = New ADODB.Recordset
rstBusGroupIn.ActiveConnection = CurrentProject.Connection
rstBusGroupIn.CursorType = adOpenKeyset
rstBusGroupIn.LockType = adLockOptimistic
rstBusGroupIn.Open ("Select * From tblBusGroups"

If I remove the filter for the BellmanArrival field, both sets of code work exactly the same. The problem seems to be that the version at work, Access2002, filters out too many records, returning an EOF error. As I said, both DB's are exactly the same except for the effects produced by this filter statement.
 
Please answer question 3, 4, 5, 6
Also, post the filter you are using.


(I am thinking the problem has to do with records with NULL fields).
 
Sorry that it took me so long to revisit this issue! The problem was an older version of ADO on my home machine. Once I updated, I was able to recreate the problem, and I worked out a quick work around. Many, mnay thanks for pointing me in the right direction!
Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top