Hello Domino Gurus,
I have a user with modified template that runs LotusScript when double clicking an item. I have condensed this down to just something like the following:
Dim dbName As String
Dim servername As String
servername=“SomeDominoServer”
dbName=“temp.nsf”
Dim db As New NotesDatabase(servername, dbName)
If db.IsOpen() Then
Print “Opened the database.”
Else
Messagebox “The server is currently unavailable. Try again later.”,48,“Error”
End If
When I add agent with same code to my user mailbox it also throws up the message box dialog saying the server is not available. It is like the user does not have the ability to create and open the database. I signed the agent to run as a different user, gave this user full rights in ECL, and then added this user to LocalDomainAdmins group and added to the Server configuration document under Security to the Administrators field, sign on behalf…as invoker, can create databases, and then it works.
For the other user though it does not. I get no security messages on the Domino console, the database does not get created, etc. No messages as to why.
When logged in as same user I can select File/Application/New and fill in the dialog details and this method will create the database and open it. LotusScript cannot.
Right now I have requested the users log.nsf and notes.ini for the notes client. Hopefully something will be in there to help determine why this is not working but any ideas from anyone I would appreciate.
Subject: good points, will check
All good points Mark. Right now those folks are on holiday weekend so I will have to begin checking all that next week. I will let you know how it goes and what I find by updating here. Thank you for the input.
Subject: Existing Server or new?
You stated ’ It is like the user does not have the ability to create and open the database. ’ - but it sounds to me more like the server cannot be found.
Is this an existing server, or fairly new server?
Is there a connection document in the user’s local address book for the server, typically in the format ’ SomeDominoServer/Domain’?
Does the connection doc specify a fqdn, or an IP address?
From the notes client, can you ‘ctrl-o’ and open the server?
In the agent, are you specifying ‘SomeDominoServer/Domain’, or just ‘SomeDominoServer’?
Is ’ dbName’ located in the data directory or ‘SomeDominoServer/Domain’? Or is it located in a subdirectory?
Have you enabled to lotusscript debugger and walked thru the agent? When you hit the line ’ If db.IsOpen() ’ - does db have a value?
Subject: Note “New NotesDatabase” doesn’t create database on disk
Some of your statements indicate that you expect the code to create a new database on the server’s file system, but the code you posted can’t do that, and the user’s rights to create databases on the server have no effect on that code.
Quote from Notes and Designer Help:
“using New for a NotesDatabase does not create a new database on disk.”
This line:
Dim db As New NotesDatabase(servername, dbName)
Should have one of the following effects:
If the specified database exists on the specified server, and the user running the code has access to the database, get an in-memory object linked to that database. IsOpen will return True;
If the specified database exists on the specified server, and the user running the code doesn’t have access to the database, throw an error; or
If the specified database doesn’t exist, get an in-memory object not linked to any database. IsOpen will return False.
I’m fairly sure it’s not possible for LotusScript to create a new blank database on disk, but it is possible for LotusScript to create a new database on disk from a template, or create a new replica of an existing database.