Here's the code.
The code works, why is it skipping some of the Link Tables?
Can anybody help?
Code:
Public Function DeleteLinkTables()
Dim oCat As New ADOX.Catalog
Dim oTable As New ADOX.Table
Dim sConnString As String
Set oCat = New ADOX.Catalog
oCat.ActiveConnection = CurrentProject.Connection
' Create a new Table object
Set oTable = New ADOX.Table
For Each oTable In oCat.Tables
With oTable
If .Type = "PASS-THROUGH" Then
oCat.Tables.Delete .Name
oCat.Tables.Refresh
End If
End With
Next
Set oCat = Nothing
Set oTable = Nothing
End Function
Can anybody help?