Solved

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

Posted on 2003-12-10
21
18,644 Views
Last Modified: 2013-12-18
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????
0
Comment
Question by:asenna25
  • 9
  • 9
  • 2
  • +1
21 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 9915752
InitializeUinsgNotesUserName is only intended for use on servers.
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9915793
In your path settings include notes exe directory (where notes.ini) resides

~Hemanth
0
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 9915889
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.

0
 

Author Comment

by:asenna25
ID: 9916002
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!!
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9916129
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.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9916148
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.
0
 

Author Comment

by:asenna25
ID: 9916202
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?
and
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!!
0
 

Author Comment

by:asenna25
ID: 9916228
qwaltee,

can't use New or Domino.NotesSession, it's calling from ASP pages using VBScript.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9916445
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.
0
 

Author Comment

by:asenna25
ID: 9917873
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!!!!


0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 13

Expert Comment

by:CRAK
ID: 9918871
I told you he could help you, didn't I?
;-)
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9921383
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.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9921435
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)?
0
 

Author Comment

by:asenna25
ID: 9928488
qwaletee,
THANKS! THANKS! THANKS!
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?

THANK YOU AGAIN!!!
0
 

Author Comment

by:asenna25
ID: 9928604
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.....
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 500 total points
ID: 9928963
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;
SELECT 1

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.
0
 

Author Comment

by:asenna25
ID: 9930001
qwaletee,

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.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9931008
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.
0
 

Author Comment

by:asenna25
ID: 9943141
qwaletee,

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")
s.Initialize
.....

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.
0
 

Author Comment

by:asenna25
ID: 9952487
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!
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9952537
Okay, sorry!  Let me know how it goes.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

Suggested Solutions

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now