Problem connection Notes to Oracle

Hi

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 ?

Thanks

Subject: Try this example…

Print “Running agent name”

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

Msgbox "Oops!" 

Else

Msgbox "Worked"

End If

connect.disconnect

Subject: Problem connection Notes to Oracle

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.

Subject: Good points … tnsnames.ora ; )

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.

Good point.

Jason

Subject: Example - connection

Option PublicUselsx “*lsxlc”

Dim s As New NotesSession

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

Subject: RE: Example - connection

I try this but on this line, i receive an error message like : Object variable not set

Dim connect As New LCConnection(“Oracle”)

Subject: RE: Example - connection

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.

Dim SAPCon As New LCConnection(“sap”)

Hope this helps.

Jason

Subject: RE: Example - connection

change the Oracle to your System Data Source name.

Subject: RE: Example - connection

I try to use my DSN name but no result, only the same error message. My server is Domino 5.10

Subject: Problem connection Notes to Oracle

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.

Jason