Jet EngineThen I moved everything to the Jet Engine. I made my text file into an access file and opened it as a dynaset. Now it takes 30 seconds for each search. Is there any cache settings or anything to put the ENGINE back on the JET?
Thanks,
From: Darren Mathis
Email: darrenm@ix.netcom.com
Secondly you should be opening the table directly as a table object instead of using a dynaset. When you open a dynaset you lose the information that the JET engine keeps about the table to help it work quickly with it. This includes index information.
Additionally the use of a Table object will allow you to use the Seek method on the table which is the most efficient way to do a search. For example, if you wanted to search for a value in a field called ID, then you would create an index for the field ID, let's say this index is called "IDSearch". You could then execute the following code to do a very rapid search of the table:
Set BigTable = MyDB.OpenTable("tblLarge")
BigTable.Index = "IDSearch" ' Set the current table index
BigTable.Seek "=", 15 ' Perform the search
This will search for the first record where the value in the ID field is equal to 15. If there is no record that matches your search then the NoMatch property of the table will be set to true. This is definitely the fastest way to search through a table. It's also very flexible if you define the right indexes.