I'm trying to open names.nsf in code. The piece of code has been working for a while but suddenly, I'm getting null. Any idea why? I don't seem to be getting any errors and I don't know how to work out what's wrong.
I can open the database from the Notes client on the same machine.
UPDATE
Here's the code. The fields are initialised in the constructor. The null reference occurs on the .IsOpen() message.
public class DominoPersonSearcher
{
private string _serverName;
private string _databaseFileName;
private string _password;
private Domino.NotesDatabase OpenDatabase(out Domino.NotesSession notesSession)
{
notesSession = new Domino.NotesSessionClass();
notesSession.Initialize(this._password);
Domino.NotesDatabase notesDatabase;
notesDatabase = notesSession.GetDatabase(this._serverName, this._databaseFileName, false);
if (!(notesDatabase.IsOpen))
{
notesDatabase.Open();
}
return notesDatabase;
}
This code is C# and runs on a web server; it's not inside a db - it's running outside of Notes, just calling into it. I've used this exact mechanism many times. It uses a .NET wrapper around the Lotus Domino Objects COM C:\notes\domobj.tlb called Interop.Domino.dll. Domino is installed on a different server.