I have a database with two agents, well there are really more than two, but two that matter right now. One works, the other does not. Both have Uselsx '*lsxlc' defined in (Options).

I have commented out everything in the failing agent except

Dim s As New NotesSession
Dim db As NotesDatabase
Dim agentLog As NotesLog
Set db = s.CurrentDatabase

'agent log  
Set agentLog = New NotesLog("Customers from Aging Report - AKM")
Call agentLog.OpenNotesLog( db.server, "agentinfo.nsf" )
agentLog.LogActions = True  'Set to True/False to turn on/off action logging
agentLog.LogErrors = True    'Set to True/False to turn on/off error logging    
Call agentLog.LogAction("Start Agent: GetCustomerDataBasedOnAging")

On Error Goto throwError

Dim lcses As New LCSession
Dim src As New LCConnection(COutConn)

%REM
....
%END REM

Exit Sub

throwError:

'Error code
Dim epos As String          
Dim emsg As String
Dim msg As String
Dim result As String
Dim status As Integer
Dim msgcode As Long

If  lcses.status <> LCSUCCESS Then
    status =  lcses.GetStatus (result, msgcode, msg)
    Call agentLog.LogError( msgcode,"Status for connector session is: " & Cstr(status) & Chr(10) & "Message: " & msg & "  Code # " & Cstr(msgcode)  & Chr(10) & "Connector Message: " & result )
    emsg = "Customers from Aging Report' Agent: ("+Cstr(Erl)+") "& "[" &Cstr(Err) & "] [" & Error$ & "]"
    Call agentLog.LogError( Err, emsg)
Else
    emsg = "Customers from Aging Report' Agent: ("+Cstr(Erl)+") "& "[" &Cstr(Err) & "] [" & Error$ & "]"
    Call agentLog.LogError( Err, emsg)
End If
Resume Next

COutConn is defined as a constant with value 'DB2'

I get the following error in the agent log:

Status for connector session is: 1544
Message:   Code # 0
Connector Message: Error: Cannot find Connector 'DB2'

This happens whether I use the constant COutConn, or "DB2".

The strange thing is that the other agent with the same definitions works properly. I know DB2 exists on the machine, it is i5/OS v5r4. DB2 is built in on this operating system.

What else do I need to look for?

有帮助吗?

解决方案

The answer is, be sure you know which machine the agent is running on. When you right click the agent in Domino Designer, and select Run, as I did, the agent is not running on the server that the database resides on, but rather inside the Domino Designer client. that is going to be Windows or Linux depending on your workstation.

So why did the one agent work while the other did not? Well the one that worked was activated from a button in the Notes Client, and the function attached to the button used Run on Server. The server was indeed IBM i. However, in the case of the failing agent, I executed that one from within Domino Designer as mentioned above, thus no DB2 connector.

Here's to hoping someone can learn from my pain!

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top