EPUB | CHM | PDF

TMySQLTable.Properties.KeyExclusive

Top Previous Next

Specifies how the upper and lower boundaries for a range should be interpreted.

Syntax:

property KeyExclusive: Boolean;

Description:

Use KeyExclusive to specify whether a range includes or excludes the records that match the starting and ending values of the range. By default, KeyExclusive is False meaning that matching values are included.

To restrict a range to those records that are greater than the specified starting value and less than the specified ending value, set KeyExclusive to True.

Example:

// Limit the range from 1351 to 1356,
// including 1351 but excluding 1356
with MySQLTable1 do
begin
// Set the beginning key
  EditRangeStart;
  IndexFields[0].AsString := '1351';
// Include 1351 in the range.
// Note that KeyExclusive applys to the range start
// because of the call to EditRangeStart
  KeyExclusive := False;
// Set the ending key
  EditRangeEnd;
  IndexFields[0].AsString := '1356';
// Exclude 1356 from the range
// Note that KeyExclusive now applys to the range end
// because of the call to EditRangeEnd
  KeyExclusive := True;
// Tell the table to establish the range
  ApplyRange;
end;