Hi
(sorry to repost but getting desparate now)
I have an agent which runs on new mail from a specific mail in database. This accesses an external dll referenced via a UNC path. If I run the agent on the server by setting it as when document is pasted and pasting the document in (using client on the server ie the same machine as I get the problem with), it works perfectly OK. If I set it for when New mail has arrived, I get the “Error in loading DLL” error. Now how can a DLL work one way but not the other?
The DLL has to reside on the network so I can’t put it locally.
Any ideas?
Thanks
Subject: Repost “Error in loading DLL”
That’s because agents that are triggered on the “On Paste” event are not running on the server, but on the client.
Your problem is due to the fact that the Domino Server is (most likely) installed as a service under the SYSTEM account. This is a local account that gives all access to the local machine, but does not have any rights whatsoever in the Windows network (i.e.: it cannot open UNC paths).
Since the “on paste” agents actually run in the Notes client, it can access the network with the same privileges as the credentials you used to logon to the machine (including network access).
The solutions to your problem are either:
– Install the DLL locally
– Install the Domino server using a regular windows domain/AD account that has access rights to the UNC path you’re using (keep in mind that this introduces some other caveats)
cheers,
Bram
Subject: RE: Repost “Error in loading DLL”
Another solution would be to map the network drive using Windows API through LotusScript.I use it in several databases and it works well. I will paste the code here later today.
Works only on Windows of course, for other OS it will be much more complicated 
Subject: RE: Repost “Error in loading DLL”
Also an option, although it requires including logon credentials in the agent code which I consider to be a big security no-no (everybody with read access to the database will be able to figure them out). On the other hand, executing code from a DLL that is hosted on a UNC path isn’t exactly my idea of best security practice either 
It also can introduce some hairy maintenance issues depending on the local network setup.
cheers,
Bram
Subject: RE: Repost “Error in loading DLL”
Hi Andrei, Bram
Thanks for your input. I have tried a few things already which relate to what you are both saying including:-
-
Stopping the server running as a service and running it directly when logged in as administrator (with full network access)
-
Creating a drive mapping and referencing the dll that way.
still getting the error.
Unfortunately, I can’t put it locally due to the type of application it is. I think I might just create my own dll locally to access it as a local vb app does work with it.
thanks again
Subject: RE: Repost “Error in loading DLL”
Cath,
IIRC once the domino server is installed as a service, running it manually from the start menu just starts up the registered service (i.e.: its still running under the local system account).
The way to get it running under a different acount, is to specify the username/password in the service properties.
→ Go to Administrative Tools, Services
→ Select the Domino service, properties
→ Select tab “Log On”
→ Set the setting to “This Account”, and fill in an AD/Domain account name and password that does have access to the particular network resource you need to have. This must be a domain/active directory account – a local account will not suffice.
Once you’ve performed this, restart the server and you should be good to go.
Keep in mind that when running under a specific account, the server console won’t be visible by default and you will have to access it using either the administrator client or the console tool.
cheers,
Bram
Subject: RE: Repost “Error in loading DLL”
Hi Bram,
I didn’t realise that it did that if it was registered as a service. I’ll try what you said next week. Thanks
cath