LOTUS CONNECTORS


Examples: FieldID method
This agent executes an SQL query, gets a field name from the user, and displays its field ID.

Uselsx "*LSXODBC"

Sub Initialize
 Dim con As New ODBCConnection
 Dim qry As New ODBCQuery
 Dim result As New ODBCResultSet
 Dim fieldName As String
 Set qry.Connection = con
 Set result.Query = qry
 con.ConnectTo("ATDB")
 qry.SQL = "SELECT * FROM STUDENTS"
 result.Execute
 fieldName = Inputbox$("Field name?", "STUDENTS table")
 If result.FieldID(fieldName) Then
   Messagebox result.FieldID(fieldName),, fieldName
 Else
   Messagebox "No such field",, fieldName
 End If
 result.Close(DB_CLOSE)
 con.Disconnect
End Sub

See Also