我正在维护一个处理来自 Lotus Notes 数据库的消息的旧版 VB6 应用程序。从 NotesDatabase 的实例中,我们获得一个 NotesDocumentCollection 并循环遍历消息:
Set domCollection = domDatabase.AllDocuments
Set domDocument = domCollection.GetFirstDocument
'Do something with domDocument
Set domDocument = domCollection.GetNextDocument
'Continue until no more documents
我的问题:是否可以知道使用 GetFirstDocument 和 GetNextDocument 方法返回文档的顺序是什么?
谢谢!
最佳答案
NotesDocumentCollection
创建,例如AllDocuments
未排序。如果查看顺序,您可能会发现文档按创建顺序出现。但这并不能保证,而且大多也无济于事。
如果您需要排序的文档列表,请使用 NotesViewEntryCollection
和排序 View 。
如果您只需要文档中的某些字段,请将它们全部放在 View 的列中,并使用 entry.ColumnValues
访问它们。通过这种方式,您可以获得比阅读每个文档更高的性能。
关于vb6 - Domino.NotesDocument Collection - 集合中项目的顺序是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16678449/