Check to see if the current database in on the server or local

The formula below only allows the user to compose a new document if the database is on the server. The LotusScript version of the same code will exit the sub routine if the database is not on the server.
Lotus Formula

FORMULA

server := @Subset(@DbName;1) ;

@If(
	server = "" ;
	@Prompt([OK];"Access Denied"; "This function can only be performed on the server replica." ) ;
	@Command([Compose]; "UP")
)



LOTUSSCRIPT

Dim session As New notessession
Dim db As notesdatabase
Set db=session.currentdatabase
	
If db.server="" Then
	Msgbox "This function can only be performed on the server replica.", 0 + 64, "Access Denied"
	Exit Sub
Else
	'database is on server, continue with code
End If

Posted by fbrefere001 on Monday November 11, 2002