Connectto not connecting

ODBC relative newbie here, be gentle. :slight_smile:

I just upgraded my development server (Windows 2003) to Domino 8.5. I am trying to use a new Data Resource on the server to connect to an Oracle Application.

I’ve defined the ODBC on the server using the ODBC Manager. I’ve used the Net Manager on the Server to update the TNSNAMES.ORA file. I’ve tested the userid and password from the server using both the ODBC Manager and the Net Manager with success. I can connect to the Oracle Tables via DECS AND Data Connections within the database.

So what’s not working? The Con.Connectto statement in the Script.

I’ve used the Lotus Debugger and stepped through the script and this is where it fails. I’ve hardcoded the ID and Password in the script as well as using variables, which works on other scripts. When I run a test script to ListDataSources… the new source is NOT in the list.

I’ve also rebooted the server.

I am really stumped.

Any thoughts? what am I missing? How does Notes get that list of DataResouces and how come it’s not finding my new resource with script.

I’m using this simple script (see below) in a form with an employee ID “UID”. It connects to the table and gets the employee first name, Last name and email based on the input value in the UID field.

I might also add that this script works fine to the Production Oracle Server which was previously defined to the LN Server but NOT to the development Oracle server which I have just defined.

Sub Click(Source As Button)

Dim con As New ODBCConnection

Dim qry As New ODBCQuery

Dim res As New ODBCResultSet

Dim ws As New Notesuiworkspace

Set uidoc = ws.CurrentDocument

If con.ConnectTo(“datasource”, “userid”, password) Then

Set qry.Connection = con

qry.SQL = _

“select * from EMPLOYEE where UID = '” + _

uidoc.FieldGetText(“UID”) + “'”

Set res.Query = qry

res.Execute

If res.IsResultSetAvailable Then

res.FirstRow

Call uidoc.FieldSetText(“UID”, _

res.GetValue(“UID”))

Call uidoc.FieldSetText(“First”, _

res.GetValue(“FIRST”))

Call uidoc.FieldSetText(“Last”, _

res.GetValue(“LAST”))

Call uidoc.FieldSetText(“Internetmail”, _

res.GetValue(“EMAIL”))

Else

Messagebox("No information found for " + _

uidoc.FieldGetText(“UID”) )

End If

res.Close(DB_CLOSE)

con.Disconnect

Else

Messagebox(“Could not connect to database server”)

End If

End Sub