My problem is that I must connect Notes server to Oracle database using an agent. On the server I create a DSN. In my agent I use this DSN and I receive this error message :
LS:DO could not complete requested operation
On my server I have a software to test my connection to Oracle and with it, my connection work great. Do you know what is the problem ?
Dim s As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim doc, doc1 As NotesDocument
Dim item1, item2 As NotesItem
'Collect new Oracle data
Dim LCsession As New LCSession
Dim connect As New LCConnection("system data source name")
Dim fldLst As New LCFieldList
Dim fld As LCField
Dim strServer As String, strUserName As String, strPassword As String
Dim count As Long
Dim x As Integer
LCsession.ClearStatus
connect.Server = "server.name"
connect.Userid = "userid"
connect.Password = "password"
connect.connect
If( connect.execute(|select EMPLOYEE, FIRST_NAME, MIDDLE_NAME, LAST_NAME, DEPARTMENT
from LAWSON.PAF_EMPLOYEE_Active;|, fldLst) = 0) Then
Do you have the Oracle client installed on the Domino server? Do you have tnsnames.ora file on the Domino server? Does your DNS reference exist within the tnsnames.ora file?
Those would be the three things I would check first.
I’ve banged my head against the wall at least twice just because someone changed a server on me, and I had not updated that tnsnames.ora file to reflect the change.
Dim db As NotesDatabase
Dim v As NotesView
Dim docdel As NotesDocument
Set db = s.CurrentDatabase
'Declare Oracle variables
Dim LCsession As New LCSession
Dim connect As New LCConnection("System Data Source Name")
Dim fldLst As New LCFieldList
Dim fld As LCField
Dim strServer As String, strUserName As String, strPassword As String
Dim count As Long
Dim x As Integer
Dim empnum As Variant
Set empnum = doc.num(0)
LCsession.ClearStatus
connect.Server = "server name"
connect.Userid = "userid"
connect.Password = "userpassword"
connect.connect
If( connect.execute(|select EMPLOYEE from LAWSON.EXEMPT_EMP where EMPLOYEE = empnum;|, fldLst) = 0) Then
Msgbox "Oops!"
End
Else
Msgbox "Worked"
End If
connect.disconnect
In my case I use:Dim SiebelCon As New LCConnection(“oracle8”)
We are using LEI 6 on the particular Domino server that runs the code above.
We had to install another driver to work with SAP, and the statement changed to the below for agents calling BAPI’s (like stored procedures) from that system.
Just make sure that when you run the agent, it is running “on” the server. Lots of times people run tests and say it works great, but it’s not running on the server, and the problem is that the connection has not been tested on the server. This is probably not the case here, but just double-check.
Other than that, please post your code and show us the line of code that throws the error.