URGENT!!! Could not open ID file...

i am ASP developer and this is the first time i deal with Lotus Notes.

I am trying to initialize an Lotus Notes Session.  however, i got an error "An exception of type 'NotesSession:Notes error: could not open the ID file' was not handled"

when i try to use InitializeUsingNotesUserName() with username and password, i got a different error message "'An invalid username/password' was not handled".

here's that section of the code:

Dim s
set s = CreateObject("Lotus.NotesSession")
Call s.Initialize("password")

'and then process documents.....

some environment info.:
i am running win2k, with lotus notes client installed.  Lotus Domino Server is not installed.

i have checked the notes.ini file, KeyFilename=user.id.  i've tried changing it to the full path, but didn't help.

i noticed if i used InitializeUsingNotesUserName() without passing parameters, then i'm fine and have no problem initializing, however, come back an error saying anonymous user not allowed to open database.

what should i do????
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

InitializeUinsgNotesUserName is only intended for use on servers.
In your path settings include notes exe directory (where notes.ini) resides

The Domino COM objects must be able to locate a valid NOTES.INI file, looking first in the Domino or Notes program directory and then at the PATH system variable. The KeyFileName setting in the NOTES.INI file specifies the user ID that COM uses.

Introduction to R

R is considered the predominant language for data scientist and statisticians. Learn how to use R for your own data science projects.

asenna25Author Commented:
thanks for responding so quickly!!!

qwaletee--- so i should use Initialize("passwordOptional"), but then i encounter the 'Could not open ID file' problem, what did i do wrong?

Hemanth---sorry i'm reeeeeaallly new to Lotus Notes, do u mean including the path in KeyFileName? (the notes.exe and notes.ini locate in C:\Program Files\lotus\notes)

here's some value from my notes.ini file...

Directory=C:\program files\lotus\notes\data
FileDlgDirectory=C:\Documents and Settings\Administrator\Desktop
KeyFileName=C:\Program Files\lotus\notes\data\user.id  

thanks again!!
Do you have multiple NOTES.INI files?

Does Notes actually use the file C:\Program Files\lotus\notes\data\user.id as the ID file if you open the client?

Have you confirmed the password to be correct?

I have had no problems whatsoever writing to the new COM interface using Domino.NotesSession.Initialize("password")

The only odd thing I ave found is that it used to call the objects Lotus.NotesSession, etc., and now its Domino.NotesSession.
Oh, that is one thing I did differently:

1) I use Domino.NotesSession, not Lotus.NotesSession

2) Dim s as New Domino.NotesSession, not CreateObject

I think I started using Dmino.NotesSession afetr installing the 6.0 client.
asenna25Author Commented:
Q1. Do you have multiple NOTES.INI files?===> No

Q2. Does Notes actually use the file C:\Program Files\lotus\notes\data\user.id as the ID file if you open the client?
Q3. Have you confirmed the password to be correct?
===>where should i go to check? is it under File>Security>User Security (sorry for asking such a stupid question....i've absolutely no experience in Lotus Notes)

thank you!!
asenna25Author Commented:

can't use New or Domino.NotesSession, it's calling from ASP pages using VBScript.
Gotcha.  So, on your IIS box, you've installed a Notes client. One problem could be filelocations.  If Notes installed its data directory under a user folder, then IIS running as a system account could have trouble finding the folder.  I would guess that is not the case from the ID file folder C:\Program Files\lotus\notes\data

Start the Notes client using a regular user login on that box.  It will prompt you for password, try the password you are using.  Then,

R5: File -> tools -> user id
R6: File -> security -> user id

You will find the user ID info, including the filename, in those settings.
asenna25Author Commented:
i checked the user id info, and it has the correct path, i.e. C:\program files\lotus\notes\data\user.id, not in the local user folder.  here's wha's in my user security:

Name -- A Senna/A Senna ==> this is the user name (A Senna/A Senna) i should use for the InitializeUsingNotesUserName(), an I correct?

ID File -- C:\program files\lotus\notes\data\user.id

I noticed something very strange....i changed the KeyFileName in notes.ini file to the complete path, save and exit.  however, if i start up the lotus notes, that value will automatically change back to KeyFileName=user.id....?????

I understand u said InitializeUsingNotesUserName() is for server, but that is the only way that i could initialize without any trouble (as anonymous user).  why would it work even though i only have the Lotus Notes installed?

Thanks in Million!!!!

I told you he could help you, didn't I?
Look for the Directory= line in NOTES.INI.  I'm sure it says C:\program files\lotus\notes\data\user.id

When Notes sees that ANY file or directory referenced in teh NOTES.INI matches this directory - e.g., keyfilename=C:\program files\lotus\notes\data\user.id
 -- it adjusts it back to just the relative path from the directory setting.  That way, if you ever move the entire Notes data directory, all you need to do is change the DIRECTORY= line.

This shoudl not cause any problem for the Initialize*(**) method, because it is using the same NOTES.INI (assuming there is only one NOTES.INI on the whole computer).

InitializeUsingNotesName does notuse the ID file at all!  It looks up the secified name in the Domino directory, and tries to match the specfied password against the Internet password field (HTTPPAssword) on teh Person doc.  There are three issues with that for you:

1) It uses the local directory, names.nsf.  On a Domino server, that is the corporate directory.  On a local client, that's just your contacts list... which does not have the names you are looking for!  Hence, you are anonymous.

2) It needs that password feld.  On a Domino server, if nobody has entered a password for that user, the authentication failes, and you get anonymous access.  On a client, it does not normally suport passwords.  So, even if you enetered A Senna/A Senna as a personal contact, you would still get Anonymous access, because there is no personal passwwrd in the entry to use for authentication.

3) Let's say you overcame all that by copying the entry from teh public directerory (which contains the password).  Theer is one more limitation.  It only alows you to access local files, since there is no trust mechanism for basic authentciation (directory user name/password, as opposed to the PKI use by the NOTES.ID subsystem).  On a server, that at least gets you access to al files on one server, though not other servers.  On a client, that gets you access only to files replicated locally.

So, no, Init***NotesUserName is not going to work very well for you.

You really have to get regular Initialize working properly.
Don't feel badly.  You thought you were making prgress getting to at least anonymous access.  You coudl not have known that it wa using a copletely different authentciation systen taht isn't very useful in your setup.  So, getting back to the track I was leading you down...

                                (Sorry, that last paragraph may sound a little arrogant, it isn't meant to be.)

If you are realy worried about that path truncation thing, move the ID file (with Notes closed) to a different folder, out of the Notes data directory tree.  When you start Notes, it will fail to find the ID, and you can navigate ti the new ocation.  When yu shut down Notes, you will see the INI file retained teh full path.

And, to reiterate an earlier question, when teh Notes client starts, does it ask you for a password? Is that password identical to the one you used in NotesSession.Initialize(passwordString)?
asenna25Author Commented:
you are GREAT!!!  your explainations explains a lot of thing, even better than most of the Lotus books, published!

Lotus didn't asked for my password after i installed it. i didn't installed the windows OS login.  it only began prompted me for a password after i changed to a new password.  i tried the new password to be used in NotesSession.Initialize(passwordString), but not working.

here's some of the setting, hope it will help you (to help me) solving this problem...

The Lotus Notes is totally standalone, no Domino Server on the network or on the client computer, only Lotus Notes 6 and Lotus Designer is installed on a standalone workstation.

Location Preferences:
Location Type - No Connection
Location Name - Island (Disconnected)
Mail File Location - Local
Mail File - data\LotusTest.nsf

User Security:
Name - A Senna/A Senna
ID File: C:\program files\lotus\notes\data\user.id

when i click on theUser Identity Type, it has a message that my aliases and Internet Email address not retrieved because my home server could not be contacted or is not configured.

Do i need to installed Domino Server, or I could have Note client run in a Domino Server-free environment?  is there any good books u could suggest on Lotus Security and Development?

asenna25Author Commented:
by the way, since this is a new install for development purposes only, there are no contacts in my Address book.

my manager is breathing down my neck.....
OK, you can use this installation. I'm not sure why the password is not working... you are absolutely certain that you DO have a password on the ID file (prompted when Notes starts), and that this password matches exactly what you put in Initialize, right?

Please re-insatll the Notes client, just in case something got hosed.

Test this using a VB or VBScript, using a logged-in full Windows client session, instead of IIS running as a daemon on the System account.  If it works using VB/VBScript -- then you know IIS is the problem, not Notes, and it probably relates to the use of the system account.  If it still fails to work, then it is the NOtes installation.

Next thingt o try after that is to try the foreground VB/VBScript again, but switch from COM to OLE automation (which causes the client to run the code with its UI visible, instead of straight calls into the API).  The code will be identical EXCEPT that:
a) CreateObject("Notes.NotesSession") instead of ("Lotus.NotesSession")
b) you do not use Initialize at all
This should at least prove whether Notes is working at al from a COM/OLE perspective, athough it probably would NOT work for IIS (because it uses the Notes client, which pops up a password prompt, which would probably fail in a System daemon environment).

We can try removingthe password, and not using Initialize, or remove the password and use Initialize with a balnk password.

As a last, last, last, last resort, we can try to "hack" the contact directory so it supports password authentication.  Create an entry for the name you wish to use, first name A, last name Senna.  On the Advanced tab, enter a User Full Name value of A Senna/A Senna. Save and close.  Then,. re-open it, confirm that A Senna/A Senna is the first entry in User Full Name, and if it is not, move it to the top line.  There should be one variation of name per line.  So it might look like:
A Senna/A Senna
A Senna

Next, with the contacts directory still open, choose CREATE AGENT.  The agent shoudl be set to run against selected document.  Chnage it from SIMPLE ACTIONS to FORMULA.  The formula you want is:

dataEntry := @Prompt([OKCancelEdit]; "Password" , "Enter the password to be used with " + @Subset(FullName;1) + " for InitializeUsingNotesUserName (I will delete leading/trailing/repeating spaces):"; HTTPPassword);
newPassword := @Trim(dataEntry);
@If(newPassword = ""; @Return(@Prompt([OK]; "Password"; "No change")); CONTINUE...");
hash := @Password(newPassword);
FIELD HTTPPassword := hash;

Name the agent CONTACT PASSWORD.  Save it.

Pick the contact you entered (without opening it, just highlight it), and choose Actions->CONTACT PASSWORD
Enter a password.

Choose Actions->CONTACT PASSWORD again, confirm there is a hashed password something like (0987654321eadfcb1234567890cbadfe)

Press Shift-Control-F9 to update indexes

Close Notes

Re-open Notes

RUn your code again with Notes open.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
asenna25Author Commented:

i'll try your suggestions, thanks.

No, the Lotus Notes doesn't ask me for apaswword either i use Logon with OS login or not.  it will only ask for my password if i change to a new password under user security tab.
Oh!  You installed the Singkle Signon for Notes, right?  Try disabling the service (it is a standard NT/2k/xp service).  See if that helps.
asenna25Author Commented:

i've tried your suggestions, but none of it worked.  however, i wrote some code in VB and i created the appointment successfully by:

Set s = CreateObject("Lotus.NotesSession")

any ideas/suggestions of why it worked with VB directly but having initialize error with ASP using vbscript?

Thanks for all your help.

p.s. have the same problem with either enabling or disabling Single Logon.
asenna25Author Commented:
i still couldb't solve the id file issue from ASP/VBScript.  i've decided to write a dll from VB and instantiate frommy ASP pages since i don't have any problem with initializing within VB.

qwaletee, thanks for all your help and advice!
Okay, sorry!  Let me know how it goes.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.