Percentused returns wrong vaule

Hi

Can anyone help, if I use db.percentused on a database I get a different value from the properties dialogbox.

Thanks

John

Subject: Percentused returns wrong vaule

There’s a bug if the db is over 2gig whereby the percent used value from lotusscript will be wrong. Solution is to use the API to work out the percent used. i.e.,

Declare Function NSFDbOpen Lib “nnotes” Alias “NSFDbOpen” ( Byval dbName As String, hDb As Long) As Integer

Declare Function NSFDbClose Lib “nnotes” Alias “NSFDbClose” ( Byval hDb As Long) As Integer

Declare Function OSPathNetConstruct Lib"nnotes" (Byval sPortName As String, Byval sServerName As String, Byval sFileName As String, Byval sPathName As String) As Integer

Declare Function NSFDbSpaceUsageScaled Lib “nnotes” Alias “NSFDbSpaceUsageScaled” (Byval hDb As Long, allocatedGranules As Long, freeGranules As Long, granularity As Long) As Integer

Dim LstrPathOS As String, LlngDBHandle As Long

Dim LdblMailPercentUsed As Double, LdblArchivePercentUsed As Double

Dim LlngAllocatedGranules As Long, LlngFreeGranules As Long, LlngGranuleSize As Long

LstrPathOS = Space(255)

OSPathNetConstruct “”, Ldb.Server, Ldb.FilePath, LstrPathOS

If NSFDbOpen(LstrPathOS, LlngDBHandle) = 0 Then

NSFDbSpaceUsageScaled LlngDBHandle, LlngAllocatedGranules, LlngFreeGranules, LlngGranuleSize

LdblMailPercentUsed = LlngAllocatedGranules / (LlngAllocatedGranules + LlngFreeGranules)

NSFDbClose LlngDBHandle

Else

LdblMailPercentUsed = Ldb.PercentUsed/100

End If

Subject: RE: Percentused returns wrong vaule

Thanks for that

That explains it the db I am working with is over 2gig.