I have just created an agent using Lotus script to query an SQL database view. However the lastname and surname field come back with False instead of the data they contain. The agent is connecting correctly to the datasource and brings back the correct number of results but the data within each field says False.
May have missed something so obtained sample script from the help file and it still brings back the same result. My script is as follows and any pointers would be appreciated.
Dim con As New ODBCConnection
Dim qry As New ODBCQuery
Dim result As New ODBCResultSet
Dim employeeNo As String
Dim firstName As String
Dim lastName As String
Dim msg As String
Set qry.Connection = con
Set result.Query = qry
con.ConnectTo("Export")
qry.SQL = "SELECT * FROM DOMINO_EXPORT WHERE SURNAME LIKE 'Crimmins'"
result.Execute
msg = "Employee names:" & Chr(10)
If result.IsResultSetAvailable Then
Do
result.NextRow
If result.IsValueNull("empid") Then
employeeNo = "None"
Else
employeeNo = _
result.GetValue("empid", _
empid)
End If
If result.IsValueNull("FIRSTNAME") Then
firstName = "None"
Else
firstName = _
result.GetValue("FIRSTNAME", firstName)
End If
If result.IsValueNull("SURNAME") Then
lastName = "None"
Else
lastName = _
result.GetValue("SURNAME", lastName)
End If
msg = msg & Chr(10) & _
studentNo & " " & firstName & " " & lastName
Loop Until result.IsEndOfData
Else
Messagebox "Cannot get result set for Employees"
Exit Sub
End If
Messagebox msg,, "Employee Names"
con.Disconnect