Lotusscript LSX connection to Oracle only works on scheduled agent

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

When the scheduled agent runs, it uses the ODBC connection that has been setup on the server. When you run it from the client(Not Schedule) it is running on the client. Make sure you have the same ODBC connection setup on your desktop where the Notes Client is installed.

Thank you for the quick answer. I did not set up the ODBC connection, my former boss did who is now retired. I inherited all responsibility of Domino, but I am mainly a developer. I have been doing some research on the ODBC connection and was able to open ODBC Data Source Administrator on the server. I see the Oracle servers listed. But, when I click on Configure to check the settings, I get an error: "The setup routines for the Oracle in OraClient12Home2 ODBC driver could not be loaded due to the system error code 126: The specified module could not be found. (C:\Oracle\product\12.1.0\client_2\SQORAS32.DLL)" It appears the directory changed to 12.2.0 - and 12.1.0 is gone. So I have some things to figure out to clean the server up.

If you have additional suggestions, I welcome ideas to get this corrected.

It is very handy for Domino devs to also know some admin. You could only become a Certified Lotus Principle in Development if you did some Admin exams as well. Likewise for Admin CLP. I would suggest getting gud.

If the "oracle" instead of "oracle8" does not work, I would suggest uninstallin12.1 and reinstallling 12.1. Reading the release notes at https://www.oracle.com/nl/database/technologies/install-odac-12c-122010.html leads me to the feeling the Oracle ODBC installer are a bit britttle. Oracle recommends usinng the exact same installer when uninstalling, in the old Oracle home. So upgrading a driver is not as straightforward as you might suspect. It seems to need a careful ritual of uninstall followed by an install of the new version.

We do the same thing ( migrating to using a Java based agent via JDBC ).

Try using just "oracle" for the New LCConnection. I recall a while ago ( years ago..... ) we had a similar problem and changing this to oracle resolved the error.

Hi Robert,

Walt is correct that when a server runs on the server it uses the server resources but when it is run manually it uses the client resources. In your code I see we are creating the LCConnection as Oracle8 this means we are using the Oracle client and not ODBC. This would indicate that you need to install the same oracle client on your Notes client(s). The Oracle client needs to match the bitness of the Notes client so unless you are using the new 12.0.2 64 bit client, we will need a 32 bit version of the Oracle client.

If we were wanting to use ODBC we need to create the connection as ODBC2 and not Oracle8.

Hope this helps