About This Code
Brief Description:
DbUtil class
Contributor:
Johan Känngård
Notes Version:
R5.x, R6.x
Last Modified:
17 Dec 2002
OpenNTF Disclaimer
All of the program code and information presented in the OpenNTF.org Code Bin are provided "as-is", and should be used at your own risk. OpenNTF.org make no express or implied warranty about anything in the Code Bin, and OpenNTF.org will not be responsible or liable for any damage caused by the use or misuse of anything from this site. OpenNTF.org makes no guarantees about anything. Please thoroughly test all of the knowledge and code you find here before you attempt to use them in your production environment.
Code / Description
Some utility methods like the @functions.
Public Class DbUtil
Function dbColumn(view As NotesView, column As Integer) As Vector
' Returns a Vector like @DbColumn. Returns Nothing if no entries in the view.
' The column is specified from index 0 as the first column.
Set dbColumn = getColumnValues(view.allEntries, column)
End Function
Function dbLookup(view As NotesView, key As Variant, column As Integer) As Vector
' Returns a Vector like @DbLookup. Returns Nothing if no entries in the view.
' The column is specified from index 0 as the first column.
Set dbLookup = getColumnValues(view.getAllEntriesByKey(key, True), column)
End Function
Public Function getColumnValues(entries As NotesViewEntryCollection, column As Integer) As Vector
' Gets the column values of the specified column in the specified collection
Dim result As New Vector()
Dim enum As New CollectionEnumeration(entries)
Do While enum.hasMoreElements()
Call result.addElement(enum.nextElement.columnValues(column))
Loop
Set getColumnValues = result
End Function
End Class
Usage / Example