Re: Sorting recordsets
- From: "ekkehard.horner" <ekkehard.horner@xxxxxxxx>
- Date: Thu, 06 Oct 2005 19:43:38 +0200
Griff wrote:
I create an empty recordset:....
I populate it with rows....
I then attempt to sort it using: oRSResults.sort = "len(firstName) desc"
And this errors telling me that the item can not be found in the collection. However, I can sort it using "firstName desc" and this works fine.
You can't use expressions/functions to specify the sort order:
cf
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/his_2004main/htm/_sna_sort_property_oledb.asp
Recordset.Sort BSTR Criteria
This parameter specifies the criteria used for sorting the Recordset object. This Sort property contains a comma-delimited list of column names and a direction specifier ...
But you could add a field for "len(firstName)" to your recordset and use this to sort. .
- References:
- Sorting recordsets
- From: Griff
- Sorting recordsets
- Prev by Date: ado.net - filling new msaccess table with data in a dataset
- Next by Date: Re: Provider cannot be found. May not be properly installed
- Previous by thread: Sorting recordsets
- Next by thread: Re: Sorting recordsets
- Index(es):
Relevant Pages
|
|