Cписок индексов таблицы + некоторые свойства индекса + список полей индекса (ADOX)
Private Sub ATest001()
ADOXListIndexTbl ("Сотрудники_Log")
End Sub
Public Sub ADOXListIndexTbl(strTblName As String)
Dim adoxCat As ADOX.Catalog
Dim adoxTbl As ADOX.Table
Dim adoxInx As ADOX.Index
Dim adoxCol As ADOX.Column
Set adoxCat = New ADOX.Catalog
adoxCat.ActiveConnection = CurrentProject.Connection
Set adoxTbl = adoxCat.Tables(strTblName)
For Each adoxInx In adoxTbl.Indexes
With adoxInx
Debug.Print "_________________________________"
Debug.Print "Индекс - "; .Name
Debug.Print "Первичный - "; .PrimaryKey
Debug.Print "Уникальный - "; .Unique
Debug.Print "Поля индекса : ";
For Each adoxCol In .Columns
Debug.Print adoxCol.Name; "; ";
Next
Debug.Print
End With
Next
End Sub
|