The Sort property on a Recordset object indicates that a recordset should be sorted.
Recordset.Sort BSTR Criteria
An example of a Sort property criteria is as follows:
The Recordset Sort property is used with an open Recordset object based on an AS/400 physical file. The Sort property allows the user to indicate which logical view to apply to an AS/400 physical file. The logical view must be a valid index specified in the description of the AS/400 physical file. The logical view is provided by the AS/400 logical file. The OLE DB Provider for AS/400 and VSAM responds to a Sort request by first closing the open physical file, and then opening the logical file that points back to the data in the physical file.
The Recordset Sort property is only supported on AS/400 hosts. If the user opens a Recordset object based on an AS/400 logical file, then there is likely no need to use Recordset.Sort. For performance reasons, applications should be written to open the AS/400 logical file first, because the overhead is so much greater when opening a physical file first.
If the CursorLocation property is set to adUseClient (use the client cursor engine), the Sort property will work if MDAC 2.0 is installed but will not work properly with earlier versions of ADO.