Powerd911 – Numéro #1 au Canada

Create Index and assign to column

Set model = ActiveModel
If (model Is Nothing) Or (Not model.IsKindOf(PdPDM.cls_Model)) Then
MsgBox “Le modèle courant n’est pas un modèle physique.”
Else

for each table in ActivePackage.Tables
set indx = table.CreateObject(PdPdm.cls_Index, “Indexes”)
indx.Name = “NewIdx” + “_” + table.Name
indx.Code = “NewIdx” + “_” + table.Code

set colObj = nothing
‘Assign column to the colObj
for each col in table.Columns
set colObj = col
exit for
next

‘Assign column to Index
set newIndexCol = indx.IndexColumns.CreateNew()
newIndexCol.column = colObj
next

Laisser un commentaire