I am comparing records in two dao recordsets using FindFirst.
rstOne is based on an attached table with about 90,000 records.
rstTwo is based on a table in the currentdb and has about 1,600.
It is taking about 5 minutes to compare all 1,600 records against the 90,000.
Here is my code:
I sped things up substantially by changing to dbOpenSnapshot, but it is still taking 5 minutes or more. Any ideas on how to speed this up some more?
Thanks,
Sup
rstOne is based on an attached table with about 90,000 records.
rstTwo is based on a table in the currentdb and has about 1,600.
It is taking about 5 minutes to compare all 1,600 records against the 90,000.
Here is my code:
Code:
Dim projDB as DAO.Database
Dim rstOne as DAO.Recordset
Dim rstTwo as DAO.Recordset
Set projDB = OpenDatabase("T:\Proj.mdb")
Set rstOne = projDB.OpenRecordset("tblOne", dbOpenSnapshot)
Set rstTwo =CurrentDB.OpenRecordset("tblTwo", dbOpenSnapshot)
Do Until rstTwo.EOF
rstOne.FindFirst "ID = '" & rstTwo![ID] & "' AND Street='" & rstTwo![Street] & "'"
If Not rstOne.NoMatch Then
'do stuff
End If
rstTwo.MoveNext
Loop
rstOne.close
rstTwo.close
Set rstOne = Nothing
Set rstTwo = Nothing
I sped things up substantially by changing to dbOpenSnapshot, but it is still taking 5 minutes or more. Any ideas on how to speed this up some more?
Thanks,
Sup