Examples: TrimTrailingSpaces property

This agent looks at the 16-character DESCRIP column in a database and replaces those rows that have all spaces with the phrase "The Description."

Sub Initialize
  Dim con As New ODBCConnection
  Dim qry As New ODBCQuery
  Dim result As New ODBCResultSet
  Set qry.Connection = con
  Set result.Query = qry
  con.ConnectTo("ATDB")
  REM WHERE clause contains 16 spaces
  qry.SQL = "SELECT * FROM STUDENTS WHERE DESCRIP = '                '"
  result.TrimTrailingSpaces = False
  result.Execute
  result.LastRow
  For i = 1 To result.NumRows
    result.CurrentRow = i
    Call result.SetValue("DESCRIP", "The Description.")
    result.UpdateRow
  Next
  result.Close(DB_CLOSE)
  con.Disconnect
End Sub