Lotus Notes and AS400 (DB2)

15 pts.
Tags:
AS/400
IBM DB2
Lotus Domino
Lotus Notes
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?

Answer Wiki

Thanks. We'll let you know when a new response is added.

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.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Shooby
    Thanks I'll give that a try!
    15 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following