I’ve found what appears to be a bug with LotusScript in Notes 6.0.1.
In the code below (used in a script library), the setConfigDoc function works perfectly in 6.0 and 5.0.x, but in 6.0.1 it fails with “Object variable not set”.
This behaviour has been seen on several computers in our organisation, though the only operating systems it’s been tested on are Windows 2000 and Windows 98 SE.
It seems as if the Initialize sub is either not running, or otherwise fails to set the db object.
Can anyone else confirm this as a bug?
If so: Lotus, please fix this.
(Declarations)
Dim s As NotesSession
Dim db As NotesDatabase
Dim configDoc as NotesDocument
Sub Initialize
'Initialise s and db
Set s=New NotesSession
Set db=s.CurrentDatabase
End Sub
Function setConfigDoc As Variant
’ Set configDoc to the database configuration document
’ Return true if successful, false otherwise.
Dim view As NotesView
If configDoc Is Nothing Then
setConfigDoc=False
'*** The following line produces "Object variable not set" in Notes 6.0.1
Set view=db.GetView("v-config")
If view Is Nothing Then Exit Function
Set configDoc=view.GetFirstDocument
If configDoc Is Nothing Then Exit Function
End If
setConfigDoc=True
End Function