Hi, I have a lotus notes web application with form fields for user input. I want to load the field values into xml and then insert the values from the XML file into a DB2 database using lotusscript.

Hi,  I have a lotus notes web application with form fields for user input.  I want to load the field values into xml and then insert the values from the XML file into a DB2 database using lotusscript.
SatishDhoteAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mekhet30Commented:
Hi

You can use the following code to create an HTML file locally.  I'm sure you can just change the HTML tags to XML

Sub Click(Source As Button)

       Dim Session As New NotesSession
      Dim ws As New NotesUIWorkspace
      Dim thisdB As NotesDatabase
      Dim ThisUIDoc As NotesUIDocument
      Dim ThisDoc As NotesDocument
      Dim OfficeDoc As NotesDocument
      Dim OfficeView As NotesView
      
      Set thisdb = session.CurrentDatabase
      Set ThisUIDoc = ws.CurrentDocument
      
      
      
      Set ThisDoc = ThisUIDoc.Document

field1 = ThisDoc.field1
field2 = ThisDoc.field2
field3 = ThisDoc.field3
field4 = ThisDoc.field4
field5 = ThisDoc.field5
      ' Create a file
      Dim text As String
      Dim fileNum2 As Integer
      fileNum2% = Freefile()
      
      FileLocation = "c:\XML\"
      
      
      FilePath = FileLocation & "export.xml"
      
      Open FilePath For Output As fileNum2%            
      
      
      Print #filenum2% , "<html> "
      
      Print #filenum2% , "<body>"
      
      Print #filenum2% , "<table border=0 width="300">"
      Print #filenum2% , "<tr>"
      Print #filenum2% , {<td width="200">}
      Print #filenum2% , {<p style="margin-top: 0; margin-bottom: 0">}
      Print #filenum2% , {T: } & field1(0) & "<br>"
      Print #filenum2% , {F: } & field2(0)&"<br>"
      Print #filenum2% , {F: } & field3(0)&"<br>"
      Print #filenum2% , {F: } & field4(0)&"<br>"
      Print #filenum2% , {F: } & field5(0)&"<br>"
      Print #filenum2% , "</tr>"
      Print #filenum2% , "<tr>"
      Print #filenum2% , {<td width="200">}
      Print #filenum2% , {<img border="0" src="} & uselogo & """ width="195" height="68"></td>"
      Print #filenum2% , "</tr>"
      Print #filenum2% , "</table>"
      Print #filenum2% , "</body>"
      Print #filenum2% , "</html>"
      
      
'Close the file
      Close fileNum2%
End Sub
      

You can atually "speak" directly with the DB2 database via Lotus Script.  This is supported from R8.  I'm sure there are other ways also to write code that will access the DB2 database directly.

Cheers
      
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.

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.