C
Cesar Romani
I'm trying to delete all the tables of an access database and have written
the following subroutine but it deletes only half the number of tables. How
I should modify the subroutine in order to delete all the tables?
--------------------------------------------
Sub deleteTables()
Dim cat As New ADOX.Catalog
Dim tbl As ADOX.Table
cat.ActiveConnection = CurrentProject.Connection
For Each tbl In cat.Tables
If tbl.Type = "TABLE" Then
cat.Tables.Delete tbl.Name
End If
Next
Set tbl = Nothing: Set cat = Nothing
End Sub
the following subroutine but it deletes only half the number of tables. How
I should modify the subroutine in order to delete all the tables?
--------------------------------------------
Sub deleteTables()
Dim cat As New ADOX.Catalog
Dim tbl As ADOX.Table
cat.ActiveConnection = CurrentProject.Connection
For Each tbl In cat.Tables
If tbl.Type = "TABLE" Then
cat.Tables.Delete tbl.Name
End If
Next
Set tbl = Nothing: Set cat = Nothing
End Sub