Re: Sorting recordsets
- From: "Mark J. McGinty" <mmcginty@xxxxxxxxxxxxxxx>
- Date: Mon, 10 Oct 2005 10:00:29 -0700
"Griff" <Howling@xxxxxxxx> wrote in message
news:%23Amz2anyFHA.4032@xxxxxxxxxxxxxxxxxxxxxxx
>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.
You would need to add a separate field for the length, and populate it when
you populate the rest of the fields, ADO's internal client-side provider
does not support use of VBA functions in expressions.
-Mark
> Any ideas?
>
> Thanks, Griff
>
.
- References:
- Sorting recordsets
- From: Griff
- Sorting recordsets
- Prev by Date: Re: Bugged by an easy problem for someone
- Next by Date: Re: Creating your own provider / database driver
- Previous by thread: Re: Sorting recordsets
- Next by thread: ado.net - filling new msaccess table with data in a dataset
- Index(es):
Relevant Pages
|
|