Hi, I have the followin agent code (an ODBC connection has prevoiusly been set in the PC and it works properly)
Sub Initialize
On Error Goto ErrorHandler
Dim session As New NotesSession
Dim WEBDoc As NotesDocument
Dim dcol As NotesDocumentCollection
Dim con1 As New ODBCConnection
Dim qry1 As New ODBCQuery
Dim result1 As New ODBCResultSet
Dim firstname As String, lastname As String
Dim tmpString As String
tmp_username="Maria de Leon"
refNr="CIP325965"
Call con1.connectTo(CONNECTTO,LOGIN,PASSWORD )
Set qry1.Connection = con1
qry1.SQL = |SELECT * From call_req, ca_contact WHERE call_req.ref_num='|+refNr+|' AND call_req.assignee=ca_contact.contact_uuid|
Set result1.query = qry1
Result1.CacheLimit ="10000"
If result1.Execute Then
If result1.IsResultSetAvailable Then
result1.NextRow
firstName = result1.GetValue("first_name")
lastName = result1.GetValue("LAST_NAME")
Messagebox (msg & Chr(10) & firstName & " " & lastName)
End If
End If
result1.Close(DB_CLOSE)
con1.Disconnect
Exit Sub
ErrorHandler:
Msgbox "Error. (Initialize) : "+Cstr(Error)+". Line: "+Cstr(Erl())
result1.Close(DB_CLOSE)
con1.Disconnect
End Sub
But Im getting the error message “The result contains no data”
I have an external tool to try the queries in the same database and it works fine, but not in Lotus notes.
When I try with a different table, I alse get the error “Cannot convert data from native to expected or required datatype”
I’ve been searching in this foro but the tips I found didnt work for me.
Could anybody please help me?
Thanks!