• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 349
  • Last Modified:

Query a disconnected recordset

I have a using disconnected recordset in an application some of which are not tied into a database (this is because in the scenario I have they are much faster than the alternatives).

So far I have been able to work very well using Filter and Sort only and this has been considerably faster than the previous code which used a large collection of classes to store data.

I have come up against a particular point where ideally I would want to run a query against this disconnected recordset in order to get a Distinct list from one of the fields.

If the query was against a database it would along the lines of:

SELECT DISTINCT MyField1 FROM MyTable1 ORDER BY MyField1 ASC

Is there any way I can do this against my disconnected recordset. I can use other techniques if necessary (by checking each record and transfering that field if it doesn't exist in the second disconnected recordset) but this will probably be slower than something that is query based.

I am using VBA so using ADO is considerably faster than anything I can develop in VBA.
0
CarlPritchard
Asked:
CarlPritchard
1 Solution
 
peter57rCommented:
Hi CarlPritchard,

AFAIK you cannot run SQL statements against a recordset.
If your required result is just a filtered version of the first it is possible to create a second recordset which contains just the filtered records, but if your intention was for more sql manipulation then I don't believe it's possible.

Pete
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now