FilterSort
Home Up OleRead MkTbls OleUpdate OSchema OLAP OleDB25 Scroll MkTblsEx FastLoad FilterSort DataShape FastAccess Indexes MultiRecords MultiProcs BLOBs

 

Example FilterSort:

        Typically, we use a SQL statement with Where and Order clauses to do filtering and sorting using a database engine at the server side. This usually works fine. However, this is not perfect at least for some cases. Here is an example. I have a list control to display multiple records, and the order of records may be changed according to what a column is clicked by a user. I don't want to ask a server to move the same data over and over again through network. To solve this problem, the best way is to use client cursor engine (CCE) to sort records at a client side from one existing rowset without issuing a SQL statement and fetching the same data from a server to a client repeatedly. We may also use CCE to filter records at client side. Even more, we can generate any number of chaptered rowsets from one existing raw rowset at a client side with the application of different filters and sorts. The example FilterSort demonstrates such a functionality of CCE, and answers the following how-tos.

  1. How to use CCE to do filtering and sorting on an existing TRowset object.

  2. How to open a COView object on an existing TRowset object.

  3. How to set a set of sorts to a COView object.

  4. How to set a set of filters to a COView object.

  5. How to apply sorts and filters to an existing TRowset object.

        Additionally, this example also shows you how to find records according to a given CFindInfo structure.

Goto the list of examples