[AccessD] Which Is Faster - DAO or db.Execute?

jim at therareshop.com jim at therareshop.com
Wed Oct 29 11:19:22 CDT 2008


<The table is a linked table - so no Seek.>

Rocky,
Using the function below allows you to perform a seek on a linked table. This is a nifty function from the microsoft website that I've been using for years without a problem.

Set db = WhichDB(strTable)

Function WhichDB(strTableName As String) As Database
Dim dbpath$, SourceTable$, dbTest As Database

On Error GoTo whichDB_ERR
Set dbTest = DBEngine(0)(0)
dbpath = Mid(dbTest(strTableName).Connect, InStr(1, dbTest(strTableName).Connect, "=") + 1)
If dbpath = "" Then
    Set dbTest = CurrentDb()
Else
    Set dbTest = DBEngine(0).OpenDatabase(dbpath)
End If
Set WhichDB = dbTest
whichDB_EXIT:

  Exit Function
  
whichDB_ERR:
  MsgBox Err.Description
  Resume whichDB_EXIT
End Function



More information about the AccessD mailing list