Using SQL is viable but calling CurrentDB twice, after all it is a function, calls a refresh of all the local database collections. I would strongly suggest that an object variable be used so you need only call CurrentDB (or opendatabase) a single time as I do not believe that it should be necessary to refresh local collections even though a table has been dropped, especially when it is in an external database.
Setting a reference via:
Workspaces(0).Databases(0)
or
Workspaces(0)(0)
instead of calling CurrentDb works with the most recently refreshed version which may be as old as the time the database was last opened and avoids even this overhead. Using CurrentDb one time to set an object variable is a useful and reasonable compromise though completely unnecessary when running SQL in an external file. In addition, opening an explict reference to the database being operated on, even via SQL, will keep the connection open saving the time to renegotiate the lock file for the external file. This can be quite significant if other users have the target file open. This can yield significant performance benefits when using SQL to reference an external mdb file with "in 'YourDB.mdb'" syntax.
I would recommend the 'OpenDatabase' method I suggested at it is simple, direct (fewer words) and trivial to set up a meaningful error handler for. And in any event, using CurrentDb to run the SQL requires DAO so DAO thoughts remain needed.
Ciao
Jürgen Welz
Edmonton AB Canada
[email protected]