ADO » DataControl » SortColumn

datacontrolobject.SortColumn = string


This feature will be removed in a future version of Windows. Avoid using this feature in new development work, and plan to modify applications that currently use this feature. Applications that use RDS should migrate to WCF Data Service.

The SortColumn Property is deprecated in ADO.

Sets or returns the column on which to perform a sort.

The SortColumn property sets a string value that identifies which column to sort. This can be either the name or alias of the column.

All pending changes need to be saved before you do a sort. For an ADO Recordeset object, use the UpdateBatch method. For a RDS DataControl object, use the SubmitChange method. If both a filter and sort operation are to occur, the filter will be performed first.

The companion SortDirection property designates if a sort will be in ascending or descending order.

In order to implement the sort, or if you change the values of either the SortDirection or SortColumn properties, you need to call the Reset method. When you call Reset, if both the filter and sort properties are in effect, the filtering will occur first followed by the sorting.


objDataControl.SortColumn = strSortCol
objDataControl.SortDirection = False

See Also: