Sorting recordsets
- From: "Griff" <Howling@xxxxxxxx>
- Date: Thu, 6 Oct 2005 14:06:04 +0100
I create an empty recordset:
' Create an empty recordset for the results
set oRSResults = CreateObject("ADODB.Recordset")
' Define it's structure
with oRSResults
With .Fields
.Append "firstName", adVarChar, 150
.Append "lastName", adVarChar, 150
.Append "orderCount", adBigInt
.Append "accountCount", adBigInt
.Append "firstOrderDate", adDate
.Append "latestOrderDate", adDate
.Append "firstUpdateDate", adDate
.Append "latestUpdateDate", adDate
End With
.Open
end with
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.
The recordset has state = 1 and recordCount > 0. Interestingly though,
using VB6's LOCALS window, when I expand the FIELDS property it shows a
Count value of 8 (which is expected), but not the properties of any of the 8
fields.
Any ideas?
Thanks, Griff
.
- Follow-Ups:
- Re: Sorting recordsets
- From: Mark J. McGinty
- Re: Sorting recordsets
- From: ekkehard.horner
- Re: Sorting recordsets
- Prev by Date: Re: simple data form
- Next by Date: ado.net - filling new msaccess table with data in a dataset
- Previous by thread: Re: simple data form
- Next by thread: Re: Sorting recordsets
- Index(es):
Relevant Pages
|
|