Initialize NotesSession with COM

I use a stand-alone Notes client at home–no connection to any Domino server; all my home databases are local. I have attempted the following code to obtain access to a Notes .ntf with Javascript:

The function is called by a button-click. The NotesSession object seems to be successfully created. However, the s.Initialize() call apparently fails.

My stand-alone client does not require a password, and the s.Initialize() call does not prompt for one.

The identical code works on my employer’s PC, which is not stand-alone. Upon execution, Notes prompts for a password, and when the password is obtained, the “alert” command executes and displays the correct version.

Does anyone know what NotesSession.Initialize() would be doing differently when executed with a stand-alone client? Is it possible it is looking for a certificate file, rather than simply checking the user.id file?

Subject: Initialize NotesSession with COM

My guess is that you’re running into the long-standing problem with the Notes 6 install failing to register the COM classes properly.

Try opening a DOS command window, switching into the Notes program directory, and doing the command “regsvr32 nlsxbe.dll”

For more info, see here:

http://www-1.ibm.com/support/docview.wss?&uid=swg21112239

-rich

Subject: RE: Initialize NotesSession with COM

Rich,Thanks for the prompt response. That seems to have worked…

Now I have another question. The next step is to create a document in a database, as follows:

{

var s = new ActiveXObject(“Lotus.NotesSession”);

s.Initialize(“”);

window.alert(s.NotesVersion); // test initialization//

var db = s.GetDatabase(“”,“C:/Notes/Data/TestBed.nsf”);

if (db.IsOpen) {window.alert(“TestBed is open”)}; //test db open//

var TestBedDoc = db.CreateDocument; // appears to be failing //

window.alert(TestBedDoc.Created);

}

The document seems not to be created–that is, I can’t obtain values for any of its properties. It says in the developer help .nsf that “New” cannot be used on a NotesDocument instance with COM. Does that mean db.CreateDocument also cannot be used with COM? The documentation implies it can.

Thanks for your help,

-TEH