Microsoft HomeproductssearchsupportshopWrite Us   Microsoft Home
Magazine
 |  Community
 |  Workshop
 |  Tools & Samples
 |  Training
 |  Site Info

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


Does this content meet your programming needs? Write us!

Back to topBack to top

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

 

Magazine Home
Ask Jane
DHTML Dude
Extreme XML
For Starters
More or Hess
Servin' It Up
Site Lights
Web Men Talking
Member Community Home
Benefits: Freebies & Discounts
Benefits: Promote Your Site
Benefits: Connect with Your Peers
Benefits at a Glance
Online Special-Interest Groups
Your Membership
SBN Stores
Join Now
Workshop Home
Essentials
Content & Component Delivery
Component Development
Data Access & Databases
Design
DHTML, HTML & CSS
Extensible Markup Language (XML)
Languages & Development Tools
Messaging & Collaboration
Networking, Protocols & Data Formats
Reusing Browser Technology
Security & Cryptography
Server Technologies
Streaming & Interactive Media
Web Content Management
Workshop Index
Tools & Samples Home
Tools
Samples, Headers, Libs
Images
Sounds
Style Sheets
Web Fonts
Training Home
SBN Live Seminars
SBN Live Chats
Courses
Peer Support
CD-ROM Training
Books & Training Kits
Certification
SBN Home
New to SBN?
What's New on SBN
Site Map
Site Search
Glossary
Write Us
About This Site