Click to return to the Data Access     
RowDelim     TextQualifier     Microsoft Tabular Data Co...    
Web Workshop  |  Data Access & Databases

Sort Property


Identifies the columns to be sorted, and ascending or descending sort order.

Syntax

dataobj.Sort = sValue

sValueString expression that is the name of one or more comma-separated names of columns in the text file. Each name can be optionally prefixed with a minus sign (-) to indicate a descending sort. By default this property is set to the empty string. If there is no header line that names the columns, they are given default names of Column1, Column2, Column3, and so on. If Sort is set to an empty string (""), no data will be sorted.

Data types are sorted as follows:
Data typeAscendingDescending
Text"a", "b", "c" ... "z""z", "y", "x" ... "a"
Numeric... -1, 0, 1, ......1, 0, -1...
Date1/1/1950, 1/1/1990, 1/1/20001/1/2000, 1/1/1990, 1/1/1950
LogicalFalse, False, ... , True, TrueTrue, True, ..., False, False

Remarks

The Sort property sorts the data displayed to the users. It can be set in the initial <OBJECT> tag description to cause initial sorting, or the browser script language can set it and sorting will take effect when the Reset method is called.

Text data is sorted case-insensitively.

Examples

The following example shows how you could sort a food list into ascending order by name and decreasing price.

dataobj.Sort = "FoodItem; -Price"

All invalid data always sorts higher than valid data. For example, a string in an ascending numeric column will display at the end. Multiple invalid data rows are grouped together but not sorted into a defined order within the group.

See Also

Filter, Reset



Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.