Writing from Access to form in Lotus Notes

Hello experts.  

I am trying to write from a table in Access 2000 to a form in a shared mailbox in Lotus Notes version R5.  

I would like it to look at the first record on a table, write to certain fields on a form in Access, then look to the next record to see if there is a match, if not, then the form will be sent out via Lotus Notes, if there is a match, it will continue to populate the appropriate fields.  This will continue to the end of the recordset.

Thanks for the help!!!
Who is Participating?
ArunkumarConnect With a Mentor Commented:
Hi !

I have a sample script try this... create an agent with the following code....Make modifications to all the commented values.

Option Public
Uselsx "*lsxodbc"

Sub Initialize
     Dim ss As New NotesSession
     Dim db As NotesDatabase    
     Dim view As NotesView
     Dim prodoc As NotesDocument
     Dim newdoc As NotesDocument
     Dim olddoc As NotesDocument
     Dim con As New ODBCConnection
     Dim qry As New ODBCQuery
     Dim result As New ODBCResultSet
     Set db = ss.CurrentDatabase
     dsn$ = "DSN NAME"
     usrname$ = "USERNAME"
     passwrd$ = "PASSWORD"
     Print "Initializing Db connection.  Please wait....."
     If Not con.ConnectTo ( dsn$ , usrname$ , passwrd$) Then
          Print "Not connected .....Exiting........!"
          Msgbox "Not connected " , , "Exiting"
          Exit Sub
          Print "Connection to Db established successfully !"          
          Set qry.Connection = con
          Set result.Query = qry          
          'Change the query to yours accordingly from Access
          If result.IsResultSetAvailable Then
               i = 1              
                    area = Trim( result.GetValue("C_AREA") ) ' Column Name to be changed.
                    ' Get as many values and put in variables as needed
                    Set view = db.GetView("(lkupAreas)")   ' A view to sort the notes entries by key (Column Value)
                    Set olddoc = view.GetDocumentByKey(area)
                    If olddoc Is Nothing Then                        
                         Print "Creating New entry in Notes for #" & i                        
                         Set newdoc = db.CreateDocument
                         newdoc.Form = "Areas" ' Your Form name
                         newdoc.Area = area ' Your Field goes here
                         'Add as many field values from the variables gotten above from columns
                         Call newdoc.Save(True, False)
                         Delete newdoc                        
                         Print "Updating existing entry in Notes for #" & i
                         olddoc.Area = area
                         Call olddoc.Save(True,False)
                         Delete olddoc
                    End If                                      
                    i = i + 1                      
               Loop Until result.IsEndOfData
          End If
          Call con.Disconnect
     End If              
End sub

Hope this is of some help to start your coding.

Good Luck!
Start looking at this and then redefine your question:

Perhaps is your question biger part better located here:

Good luck,

Oh Zvo!

just in front.
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

I do not see you online in Groove.
Why do you not start it when you are dialed in?

pucktarget2Author Commented:
Thanks for the help.  I should be able to test some of this tomorrow when my Oracle connection is fixed (new PC problem, unrelated to question).

I am always connected from home.  I just dont start it Sorry.  Will do it more often okay bud ?
OK, but now I go to bed and tomorrow I am for four days away to another town :-)

But afterwards...

Cheerio Arun :-)

By the way: thank you for making me manager in YOUR shared space, Bro :-)
pucktarget2Author Commented:
I should be able to try some of this code today.
pucktarget2Author Commented:
Hey Arun, I was looking at your code and had a question.  I forgot to mention that this process will be automated (the program will open on a timer in the a.m.).  Will this have an affect on the code or can it still be used as is?
OK pucktarget,

give me some more details about your Access data source name table and field names so I can build the LotusScript agent more readable for you.

So long,

Nope !

It should not have any effect as long as your server has the dsn setup with the odbc drivers !

Good Luck!
pucktarget2Author Commented:
Thanks for the help.  I am not really a Notes developer so the help is greatly appreciated.  Mainly I am learning on the fly here.  


I have a question located on the Access forum for the same topic, I would like you to take those points.  The link is below. There were no responses from anyone in the Access forum anyway.  Thanks for the offer to build but I would like to give it a go and if I have a problem I will post a question rather than asking you to build one for me.  Gotta learn somehow.  THANKS!!!


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.