Domino 9 und frühere Versionen > Administration & Userprobleme
DB per Script in einem Agent öffnen
Hoshee:
Yoo,
ich möchte in einem Agent, der auf einem Server läuft, eine Datenbank eines anderen Servers öffnen (mit LotusScript).
Anscheinend ist das aber nicht so wirklich erlaubt :P
Gibt es eine Möglichkeit, diese Restriktionen zu umgehen?
Rätselt ...
Hoshee
eknori:
Also isch wüßte nicht, warum das nicht gehen sollte.
Hier scheint mir ein Zugriffsproblem vorzuligen.
Hast du den Agenrten mit der ServerID unterzeichnet ?
Hat der Server überhaupt eine Zugriffsberechtigung auf den fremden Server ( und auf die DB ) ??a
Hoshee:
Yoo,
von den Rechten her sollte alles i.O. sein.
Im Protokoll des Agent bekomme ich folgende FM:
--- Code: ---
03.04.2002 14:34:51: Error 4164: Cannot open databases on machines other than the server running your program (SRVXXXXXX/XXX!!names.nsf)
--- Ende Code ---
Gruss ...
Hoshee
eknori:
Hab das hier in der Knowledgebase gefunden.
Ich denke, daß du hier die Lösung findest.
Error: "Cannot Open Databases on Machines Other than the Server..."
Problem:
You have created a scheduled background agent that contains code similar to one of the samples below. When you run the agent manually, it runs successfully. When the agent is executed via the schedule, the following error message is written to the server's log file (LOG.NSF).
"Cannot open databases on machines other than the server running your program"
Code Sample #1:
Dim mySession as new NotesSession
Set myDB = mySession.GetDatabase("Server1","DBName.nsf")
'...
Code Sample #2:
Set DB = new NotesDatabase("Server1","DBName.nsf")
'...
Solution:
When a LotusScript agent generates the error when run as a background agent but runs fine when executed manually, use the following steps to troubleshoot the issue:
1. This error occurs when the .NSF file you are accessing is located on a server other than the server where the background agent is running and when the server argument is not left empty.
For example, the following two code samples in a scheduled agent cause the error:
Code Sample #1:
Dim mySession as new NotesSession
Set myDB = mySession.GetDatabase("Server1","DBName.nsf")
'...
Code Sample #2:
Set DB = new NotesDatabase("Server1","DBName.nsf")
For security reasons, a background agent can access only databases that are local to the server where the agent is running. To signify that the target database is located on the current (local) server in a scheduled agent, the server argument must be defined as a null string. In the samples above, when "DBName.nsf" is located on the server where the agent is running, you must use the following syntax to identify the database:
For Sample #1:
Dim mySession as new NotesSession
Set myDB = mySession.GetDatabase("","DBName.nsf")
'...
For Sample #2:
Set DB = new NotesDatabase("","DBName.nsf")
'...
2. The user who last saved or "stamped" the agent must be listed in the Run Unrestricted LotusScript Agents fields in the server document. It may take a period of time for this update to take effect. If it's necessary for the changes to take effect immediately then the Domino server would need to be shutdown and restarted. For testing purposes, you can use an asterisk (*) entry in this fields to allow all users to run Unrestricted LotusScript calls - this should be done with some consideration as it will allow all users to run Unrestricted functions and methods. Note: When you have rights to run Unrestricted calls and methods this includes the rights to run the functions and methods which fall into the Restricted class. For more information on the calls and methods that require Unrestricted access, see the document 137846 titled, 'LotusScript Agents that Require User's Name in "Run Unrestricted Agents"' ().
3. The full hierarchical name of the server must be specified in LotusScript methods that reference databases via the NotesDatabase Class. For example, when using the Open method:
Call db.open("ServerA1/US/ACME","sales.nsf")
4. The server name must be listed explicitly in any referenced database's ACL and listed as Server, Manager.
5. The following Notes methods are disallowed.
db Open, db OpenIfModified, new db, OpenMail
Supporting Information:
An enhancement request has been submitted to Lotus Quality Engineering to request that LotusScript have the functionality to access a database on another server.
grosses.manitu:
Abend,
wie schon eknori geschrieben/kopiert hat, es ist nicht moeglich von einem Server ueber einen Agent der auf dem Server (nicht lokal) laeuft auf eine andere Datenbank zugreifen, die auf einem anderen Server liegt.
Das Problem kannst aber umgehen, wenn Du eine Replica (wie auch immer das in Deutsch heisst;-) ) der Datenbank auf den Server machst, wo der Agent laeuft.
Navigation
[0] Themen-Index
[#] Nächste Seite
Zur normalen Ansicht wechseln