Hi,
In my accDB with tables linked to sql server I have a form where recordsource is a table with +60K records. When I use access "build in search" it is very slow (+60sec). In ADP the result is < 3sec.
Is ODBC/Linked tables not using table indexes, is there any way to speed up search?
I have tried creating custom vba search as below, its working but is really slow too.
Set rs = frm.Recordset.Clone
rs.FindFirst "[" & strSearchField & "] = '" & strSearchFor & "'"
frm.Bookmark = rs.Bookmark
Also when searching directly in tables linked tables are much slower than adp. Is this by design or could I be doing something wrong?
Thanks,
Jakob
Comparing an accdb with an adp is not wise. They are two very different beasts. The tables you see in an adp are actually SQL Server tables and you are interacting directly with the server (think of it as a windows directly into SQL Server). In an accdb, you have linked tables and the data is "mirrored" into your local tables and so you 60K+ records have to travel from the SQL Server to your PC - they do not in the adp. An adp uses OLEDB to connect, whereas an accdb uses ODBC.
Your example above needs for Access to load ALL records from your table into the PC, then pass through them one by one to find the first match.
Kelvin