15 pts.
 Lotus Notes and AS400 (DB2)
I have a form in Notes where a user enters a reference number. When the user clicks the submit button I want to Validate their reference number against a table on our AS400. I am able to do this with an ODBC connection on my workstation but... MANAGEMNT does not want users to have any type of connection or DB2 clients loaded on their work station. Any ideas onhow to accomplish this?

Software/Hardware used:
ASKED: January 22, 2008  5:55 PM
UPDATED: January 22, 2008  9:59 PM

Answer Wiki:
Hi Shooby, You could look up the external table using an ODBC connection that only resides on the server. Then to lookup the external table call an agent from your Notes document when any event happens. i.e. When the user exits the field the Change Event will run or when they Save the document the Save event will run. This agent that you run set it to RunOnserver. So the code in your will look like this 'Code Dim session As New NotesSession Dim db As NotesDatabase Dim theAgent As NotesAgent Set db = session.CurrentDatabase Set theAgent = db.GetAgent( "YOUR_AGENT_NAME" ) flag = theAgent.RunOnServer If flag <> 0 Then ' Print theagent.Name & " encountered a issue and didn't run as expected." Else Print theagent.Name & " ran as expected." End If 'end of this code In the agent lookup the table via ODBC To get the value returned from the ODBC table you can do this various ways 1) Set an Enviroment Variable from the Agent with the return value 2) Set a global variable in your Notes Doc, assign a value to that var in the agent 3) Set a hidden field on you Notes doc. Let me know if you need anymore help. If this doesn't satisfy your MGT you could use JAVA to create a JDBC connection on the fly. You'd have to do an install on the server though. So the above code you might have to do a server install. MGT are very wary of these installs but I have done then countless times and they are perfectly safe.
Last Wiki Answer Submitted:  January 22, 2008  6:22 pm  by  Jellybean   405 pts.
All Answer Wiki Contributors:  Jellybean   405 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Thanks I’ll give that a try!

 15 pts.