Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 305
  • Last Modified:

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!!!
0
pucktarget2
Asked:
pucktarget2
  • 4
  • 4
  • 4
1 Solution
 
zvonkoCommented:
Start looking at this and then redefine your question:
http://www-10.lotus.com/ldd/sandbox.nsf/ecc552f1ab6e46e4852568a90055c4cd/6704c9ebb583859f8525694d004e51b0?OpenDocument

Perhaps is your question biger part better located here:
http://www.experts-exchange.com/msaccess/

Good luck,
zvonko

0
 
ArunkumarCommented:
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"
          Print
          Exit Sub
     Else
         
          Print "Connection to Db established successfully !"          
         
          Set qry.Connection = con
          Set result.Query = qry          
         
          'Change the query to yours accordingly from Access
          qry.SQL = "SELECT DISTINCT C_AREA FROM MPMASTR_TBL"
         
         
          result.Execute
         
          If result.IsResultSetAvailable Then
               i = 1              
               Do                                        
                   
                    result.NextRow
                    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                        
                    Else
                         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
               
               Print
               
               result.Close(DB_CLOSE)
               
          End If
         
          Call con.Disconnect
         
     End If              
End sub
==============

Hope this is of some help to start your coding.

Good Luck!
Arun.
0
 
ArunkumarCommented:
Oh Zvo!

just in front.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

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



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

0
 
ArunkumarCommented:
I am always connected from home.  I just dont start it Sorry.  Will do it more often okay bud ?
0
 
zvonkoCommented:
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 :-)
0
 
pucktarget2Author Commented:
I should be able to try some of this code today.
0
 
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?
0
 
zvonkoCommented:
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,
zvonko

0
 
ArunkumarCommented:
Nope !

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

Good Luck!
Arun.
0
 
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.  

Zvonko,

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!!!

http://www.experts-exchange.com/jsp/qManageQuestion.jsp?ta=msaccess&qid=20298462

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 4
  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now