OpenRecordset and ODBC linked tables

mardi 5 mai 2015

I am using the function below to check if my Linked ODBC tables are good. It works, but when it gets to tables that have a lot of columns, it takes about 5 seconds to return. I am checking about 56 tables and it could take up to 10 - 15 seconds. I tried using "Select 1 from tablename" and also tried "Select top 1 fieldname from tablename" as the source in Openrecordset() but it took the same amount of time. How could I speed this up ?

Function IsODBCConnected(TableName As String) As Boolean
If Not TableExists(TableName) Then Exit Function

Dim rst As DAO.Recordset

On Error Resume Next
Set rst = CurrentDb.OpenRecordset(TableName, dbOpenSnapshot)
IsODBCConnected = (err.Number <> 3151)
End Function
OpenRecordset and ODBC linked tables

0 commentaires:

Enregistrer un commentaire

Labels