I have a few lotusscript agents that connect to an Oracle server using LSX Connector. The agents work fine when set as a scheduled agent. However, when I try to run them manually to debug the lotusscript (such as right click on the agent and select "run"), I get an error. It fails at the line for New LCConnection:
Dim LCon As New LCConnection("oracle8")
The error window says "Error creating product object".
In the security setting, I have tried "Run on behalf of" with a few different ids, but same error occurs. Is there a setting in the agent I need to set or is there a Domino Administrator setting needed for agents? Any insights on this would be greatly appreciated. Below is the code. Thank you!
Option Public
UseLSX "*lsxlc"
Dim currdb As NotesDatabase
Dim agent As NotesAgent
Sub Initialize
Dim s As New NotesSession
Set currdb = s.currentdatabase
Set agent = s.CurrentAgent
Dim LCses As LCSession
Dim LCcon As New LCConnection ("oracle8")
Dim LCfldLst As New LCFieldList
If s Is Nothing Then Set s = New NotesSession
LCcon.Server = "(server)"
LCcon.Userid = "(userid)"
LCcon.Password = "(password)"
LCcon.OracleTextFormat = "UTF8"
LCcon.Connect
'set the stored procedure owner and stored procedure name in one line...
LCcon.Procedure = "BANINST1.P_MCC_GET_STU_EMAIL"
'set Fieldnames property with any output parameters declared in the stored procedure...
LCcon.Fieldnames = "p_email"
'declare any fields and fieldlists for input/output data...
Dim inputParams As New LCFieldList
Dim outputParams As New LCFieldlist
Dim inputValue As LCField
Dim outputValue As LCField
Dim out As Double
'set the input parameters of the stored procedure...
Set inputValue = inputParams.Append ("p_pidm", LCTYPE_TEXT)
inputValue.Value = "12345"
'with the input parameters set, call the stored procedure...
out = LCcon.Call (inputParams, 1, outputParams)
'fetch parameter(s) into the outputParams fieldlist...
out = LCcon.Fetch (outputParams)
'retrieve the parameter(s) from the outputParams fieldlist...
Set outputValue = outputParams.GetField (1)
'print the result
Print "Print Result"
Print outputValue.Value(0)
LCcon.Disconnect
End Sub