LOTUS CONNECTORS


Examples: IsValueAltered method
This script executes when a field is entered and displays a message if the result set column with the same name has changed. The form that contains the button contains other scripts that declare global variables, load the result set, and process the result set. The global declarations and a portion of the Postopen script are shown.

Uselsx "*LSXODBC"

Dim con As ODBCConnection
Dim qry As ODBCQuery
Dim result As ODBCResultSet

Sub Postopen(Source As Notesuidocument)
 Set con = New ODBCConnection
 Set qry = New ODBCQuery
 Set result = New ODBCResultSet
 Set qry.Connection = con
 Set result.Query = qry
 con.ConnectTo("ATDB")
 qry.SQL = "SELECT * FROM STUDENTS ORDER BY LASTNAME"
 result.Execute
 ...
End Sub

Sub Entering(Source As Field)
 Dim workspace As New NotesUIWorkspace
 Dim uidoc As NotesUIDocument
 Set uidoc = workspace.CurrentDocument
 If result.IsValueAltered(uidoc.CurrentField) Then
   Messagebox "This field was changed by SetValue",, _
   "Field is altered"
 End If
End Sub

See Also