If you use the NotesSession.NotesBuildVersion property, it returns the build
number of the machine that the script is running on. This will actually be the
client build number if you are running say, an action button in the Notes
client from within a server-based db.
To use the function, just pass it a server name and it will return the build
number (which will be 166 for R5.x). The sample button code below, if run from
a Notes client against a server-based db, will return the build version of the
server it is running on:
Sub Click(Source As Button)
Dim session As New NotesSession
Dim build%
build%=GetServerBuild(session.CurrentDatabase.Server)
If build% <> 0 Then
If build% < 166 Then
Msgbox "Server is not a release version of R5 [build: " & Cstr(build%) &
"]"
Else
Msgbox "Server is R5 [build: " & Cstr(build%) & "]"
End If
Else
Msgbox "Function failed."
End If
End Sub
'(Declarations)
Declare Function NSFGetServerLatency Lib "nnotes" (Byval ServerName As String,
Byval Timeout As Long, Byval retClientToServerMS As Long, Byval
retServerToClientMS As Long, ServerVersion As Integer) As Integer
Function GetServerBuild(serverName$) As Integer
Dim status%, build%
build%=0
status%=NSFGetServerLatency(serverName$,
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts focused on Lotus Domino, Notes, Workplace and other related technologies.
GetServerBuild=build%
End Function
This was first published in November 2000