When working with DQL, best practice is to create/update/remove indexes programmatically using their according methods.
To avoid conflicts with existing views of the same name, all indexes created should have a prefix.
This can be achieved by using a static string.
Const prefix = "dql1_"
call dql.createIndex(prefix & "idxBySubject", arrFields)
For the sake of object oriented programming, (Notes)DominoQuery should be enhanced by a new property - "namespace"
This makes it easier to keep the maintenance of indexes consistant. Especially, if you have more than one DQL object.
Dim dql As NotesDominoQuery
Set dqlOne = db.Createdominoquery()
Set dqlTwo = db.Createdominoquery()
Set dqlOne.namespace = "dql1_"
Call dqlOne.Createindex("idxBySubject", arrFields)
Set dqlTwo.namespace = "dql2_"
Call dqlTwo.Createindex("idxBySubject", arrFields)
This would automatically create indexes
(dql1_idxbySubject)
(dql2_idxbySubject)
dqlOne.removeIndex("idxbySubject") would automatically find the correct view/index by the namespace
by Ulrich Krause