Deleting a Table from a Database : Table Delete « Access « VBA / Excel / Access / Word






Deleting a Table from a Database

 
Sub Delete_Table()
   Dim cat As ADOX.Catalog

   On Error GoTo ErrorHandler
   Set cat = New ADOX.Catalog

   cat.ActiveConnection = CurrentProject.Connection
   cat.Tables.Delete "java2sTable"
   Set cat = Nothing
   Exit Sub

ErrorHandler:
   MsgBox "Table '" & "tblFilters" & _
       "' cannot be deleted " & vbCrLf & _
       "because it does not exist."
   Resume Next
End Sub

 








Related examples in the same category

1.Deleting a Table with SQL command