Does Microsoft really say that DAO is much faster for Jet databases? For everything?
Try the following experiments - here tweaking hwkrangers code to match PHV's:
[tt]' in the declaration section
Private Declare Function QueryPerformanceCounter Lib "Kernel32" _
(lpPerformanceCount As Currency) As Boolean
private sub testdao
dim s as string
dim c as currency
dim c2 as currency
if QueryPerformanceCounter(c) then
s = CurrentDb.TableDefs(strTable).Indexes("PrimaryKey").Fields(0).Name
QueryPerformanceCounter c2
debug.print "DAO version: ", c2-c, s
end if
End Sub
private sub testado
dim s as string
dim c as currency
dim c2 as currency
if QueryPerformanceCounter(c) then
s = CurrentProject.Connection.OpenSchema( _
adSchemaPrimaryKeys, Array(Empty, Empty, _
"YOUR_TABLE_NAME_HERE")).Fields(3).Value
QueryPerformanceCounter c2
debug.print "DAO version: ", c2-c, s
end if
End Sub[/tt]
On my setup, the ADO version is on average 30% faster.
For more info on this timer, have a look at
Roy-Vidar