WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: hienpham on July 28, 2014, 05:32:47 PM

Title: Access Lotus Notes
Post by: hienpham on July 28, 2014, 05:32:47 PM
Hi,
   I use WinBatch to access the Lotus Notes database as follow:

      oLN = createobject("Lotus.NotesSession")
   if oLN == 0
       Message("Warning", "Cannot Access")
       exit
    endif
        sss = oLN.Initialize          ; we have to provide the password
       ccc = oLN.CommonUserName      ;
       dir = oLN.GetDbDirectory("<servername.domain.com")      

this section is just the start of a larger script. We will set the script as a cron job that will run everyday.
We do not have any problem accessing the database but the problem that we have is:  "    sss = oLN.Initialize   "  that prompts us for password any time we run the script.
How can we solve that problem? Can we somehow preset the password? This WinBatch script will be compiled and the password will also be hidden.

thanks
hien

Thanks
Title: Re: Access Lotus Notes
Post by: td on July 29, 2014, 06:40:29 AM
According to the Lotus Notes class documentations you can use the 'InitializeUsingNotesUserName' method to specify a user name and password.

http://www-12.lotus.com/ldd/doc/domino_notes/Rnext/help6_designer.nsf/f4b82fbb75e942a6852566ac0037f284/8cb15cebdc3fcfc285256c54004d46a2?OpenDocument (http://www-12.lotus.com/ldd/doc/domino_notes/Rnext/help6_designer.nsf/f4b82fbb75e942a6852566ac0037f284/8cb15cebdc3fcfc285256c54004d46a2?OpenDocument)
Title: Re: Access Lotus Notes
Post by: hienpham on July 29, 2014, 02:20:30 PM
Thanks TD, with your help, I got all the information that I need.
Thanks again.
hien