I would like to know if anyone knows a way to run the compact automatically on the local machine of the end users. When you upgrade a client to R6.5.x the local replica seems to keep the ODS 41 version and not the 43. Therefore you get some issues with the read unread feature. I would like to automatically compact the local mail file of the user. Running the ncompact in the logon script does not seem to be an option as it requires the notes password. Any idea is welcome.
I think you can change the design of the database to have that done and using the CompactWithOptions method. I put some code in design of inotes6.ntf, in “other”, “database ressources”, “database script”, event “Postopen”. Our pb was that our remote users which were working only in local db were not getting the message about quota and their mailboxes were only get growing. So, when the mailbox is opened in local, I try to connect the mail server, to get the quota value and to apply it to the local db (because quota does not replicate). After that, I put a “meesage box” to harrass the users. At the begin of the code I compact the db, if used in local. This is the code I put in inotes6.ntf :Sub Postopen(Source As Notesuidatabase)
Dim db As NotesDatabase
Dim rid As String
Dim s1, message As String
Dim s, sq As Integer
Dim delta As Long
s1="mymailserver"
Set db=source.database
If db.Server="" Then
delta = db.CompactWithOptions("bLS10")
Print "Compacted ! Size difference in bytes: " + Format(delta)
End If
s=db.Size/1024/1024
Print "Size="+Format(db.Size/1024/1024)+"MB"
If db.Server="" Then
rid=db.ReplicaID
Dim dbs As New NotesDatabase( "", "" )
If dbs.OpenByReplicaID( s1, rid ) Then
' Print( dbs.Title & " was successfully opened on "+s1 )
db.SizeQuota = dbs.SizeQuota
Else
' Print( "Unable to open database on "+s1 )
End If
End If
If db.SizeQuota=0 Then
' Print "No quota"
Else
sq=db.SizeQuota/1024
Print Format((db.Size/1024)/db.SizeQuota,"Percent")+" of quota used"
Print "Quota="+Format(db.SizeQuota/1024)+"MB"
If s>sq And db.Server="" Then
message="Quota is "+Format(sq)+"MB, while current size is "+Format(s)+"MB. You must archive or delete some documents of your database"
Messagebox message , 48 , "Your database exceed quota."
End If
End If