Solved

Writing from Access to form in Lotus Notes

Posted on 2002-05-08
12
257 Views
Last Modified: 2013-12-18
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
Comment
Question by:pucktarget2
  • 4
  • 4
  • 4
12 Comments
 
LVL 10

Expert Comment

by:zvonko
ID: 6997084
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
 
LVL 9

Accepted Solution

by:
Arunkumar earned 100 total points
ID: 6997085
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
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6997086
Oh Zvo!

just in front.
0
 
LVL 10

Expert Comment

by:zvonko
ID: 6997107
I do not see you online in Groove.
Why do you not start it when you are dialed in?



0
 

Author Comment

by:pucktarget2
ID: 6997278
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
 
LVL 9

Expert Comment

by:Arunkumar
ID: 6997342
I am always connected from home.  I just dont start it Sorry.  Will do it more often okay bud ?
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 10

Expert Comment

by:zvonko
ID: 6997385
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
 

Author Comment

by:pucktarget2
ID: 7001153
I should be able to try some of this code today.
0
 

Author Comment

by:pucktarget2
ID: 7001162
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
 
LVL 10

Expert Comment

by:zvonko
ID: 7014739
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
 
LVL 9

Expert Comment

by:Arunkumar
ID: 7015259
Nope !

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

Good Luck!
Arun.
0
 

Author Comment

by:pucktarget2
ID: 7021483
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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

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

13 Experts available now in Live!

Get 1:1 Help Now