Hello all,
I'd like to remove every index of a table. I didn't find any property, which can do this. All I could come up with was the indexed field names. Can anyone help me with this.
I'd like to remove every index of a table. I didn't find any property, which can do this. All I could come up with was the indexed field names. Can anyone help me with this.
Code:
'remove indexes from a table
Public Sub remove_index()
Dim catcurr As New ADOX.Catalog
'Dim tbl As ADOX.Table
Dim idx As ADOX.Index
Set catcurr.ActiveConnection = CurrentProject.Connection
'tbl.Name = "STU200501_0110052"
With catcurr.Tables("data")
For Each idx In .Indexes
'Debug.Print idx.Name
Debug.Print idx.Properties.Count
'idx
Next
End With
End Sub