MS Access: Drop all link tables

Below is the function to drop all link tables available in access file. We cal call where ever it is required.

Public Function DropLinkTables()
   'delete any tables where connection property has ODBC in it
   Dim tdf As DAO.TableDef
StartAgain:
 For Each tdf In CurrentDb.TableDefs
    If InStr(1, tdf.Connect, "ODBC") Then
       DoCmd.DeleteObject acTable, tdf.Name
       GoTo StartAgain
    End If
 Next tdf
 Set tdf = Nothing
End Function

1 comment:

  1. Litchi is a subtropical fruit tree of family Sapindaceae with great economic and nutritional value. Based on fruit anatomy, the fruit of litchi is a drupe with an edible aril enclosing a single seed surrounded by a pericarp.
    spacebar clicker

    ReplyDelete