Programmatically determine if LargeSummary is enabled on a database
A couple of days ago, I wrote about how you can determine which database on a server has LargeSummary enabled using the show dir command from the Domino console.
You can use LS2CAPI to dertermine, if the flag is set. Here is the code
Public Type DBOPTIONS
options (3) As Long
End Type
Public Const W32_LIB = {nnotes.dll}
Public Const TUX_LIB = {libnotes.so}
Declare Function W32_NSFDbGetOptionsExt Lib W32_LIB Alias {NSFDbGetOptionsExt}_
(ByVal hdb As Long, retDbOptions As DBOPTIONS) As Integer
Declare Function W32_NSFDbOpen Lib W32_LIB Alias {NSFDbOpen}_
(ByVal dbName As String, hDb As Long) As Integer
Declare Function W32_NSFDbClose Lib W32_LIB Alias {NSFDbClose}_
(ByVal hDb As Long) As Integer
Declare Function TUX_NSFDbGetOptionsExt Lib TUX_LIB Alias {NSFDbGetOptionsExt}_
(ByVal hdb As Long, retDbOptions As DBOPTIONS) As Integer
Declare Function TUX_NSFDbOpen Lib TUX_LIB Alias {NSFDbOpen}_
(ByVal dbName As String, hDb As Long) As Integer
Declare Function TUX_NSFDbClose Lib TUX_LIB Alias {NSFDbClose}_
(ByVal hDb As Long) As Integer
Public Function NSFDbGetOptionsExt (hDb As Long, retDbOptions As DBOPTIONS)
If isDefined("WINDOWS") Then
NSFDbGetOptionsExt = W32_NSFDbGetOptionsExt(hDb, retDbOptions)
Else
NSFDbGetOptionsExt = TUX_NSFDbGetOptionsExt(hDb, retDbOptions)
End If
End Function
Function NSFDbOpen( db As string, hDB As Long) As Integer
If isDefined("WINDOWS") Then
NSFDbOpen = W32_NSFDbOpen(db,hDb)
Else
NSFDbOpen = TUX_NSFDbOpen(db,hDb)
End If
End Function
Function NSFDBClose (hDb As Long)
If isDefined("WINDOWS") Then
NSFDbClose = W32_NSFDbClose(hDb)
Else
NSFDbClose = TUX_NSFDbClose(hDb)
End If
End Function
And here is how you can use the code
Const DBOPTBITS_3 = 3
Const DBOPTBIT_LARGE_BUCKETS_ENABLED = &h104
Sub Click(Source As Button)
Dim hDb As Long
Dim rc As Integer
Dim sDb As String
Dim retDbOptions As DBOPTIONS
sDb = "serv04/singultus!!ua.nsf"
rc = NSFDbOpen(sDb, hDb)
If rc = 0 Then
rc = NSFDbGetOptionsExt (hDb, retDbOptions)
If retDbOptions.options(DBOPTBITS_3) _
And DBOPTBIT_LARGE_BUCKETS_ENABLED Then
Msgbox "LargeSummary enabled"
Else
Msgbox "LargeSummary not enabled"
End If
rc = NSFDbClose(hDb)
End If
End Sub