AddIndexTable




Dim tmpIndex as New Index
Dim db as Database
Const DBName$ = "youre_database_name"
Const Tb$ = "youre_table_name_you_want_to_index"
Const tmpFieldName$ = "the_field_on_which_you_want_the_index"
Set db = OpenDatabase(DBName)
tmpIndex.Name = "testing"
tmpIndex.Fields = tmpFieldName
'if you don't want to have duplicates else leave it out

tmpIndex.Unique = True
db.TableDefs(Tb$).Indexes.Append tmpIndex
db.Close










( addindextable.html )- by Paolo Puglisi - Modifica del 17/12/2023