This works to drop all linked tables but now that the database has grown so large I have split it into 3 backends. I only want to drop linked tables from one of the dbs: salesauto_be.accdb
Project is all Access databases.
I could cycle through each table name but with over 100 tables and growing, it is not practical nor efficient.
Thank you
Project is all Access databases.
Code:
On Error GoTo Err_Load
Dim db As DAO.Database
Set db = CurrentDb()
Dim tDef As DAO.TableDef
Dim strFi As String
'drop all linked dbfs
For Each tDef In CurrentDb.TableDefs
If CBool(Len(tDef.Connect)) Then
Debug.Print "Dropping linked Table: "; tDef.Name
CurrentDb.Execute "DROP TABLE [" & tDef.Name & "]"
End If
Next
I could cycle through each table name but with over 100 tables and growing, it is not practical nor efficient.
Thank you