Is it possible to query a disconnected recordset?

Posted on 2003-02-26
Medium Priority
Last Modified: 2010-05-01
I have created and populated two disconnected ADO recordsets.  I would like to query them and produce a third recordset.  (This is temporary data, so saving it to SQL is just extra overhead).  Is this even possible?
Question by:bfredrickson
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

Expert Comment

ID: 8028470
Well Fred,
Depending on the numbers of records that your talking about you could cycle through your recordsets and apply your logical criteria to them as you go.  Then when something matched your criteria/query you could put that record into an array for later use.  To cycle through the records use logic to the effect of:
Do until Rec.EOF=True
'See if record matches criteria
If its too many records this may not be a desireable approach though.  Anyway just an idea.

Author Comment

ID: 8028521
Records range from 200 to 750,000.  I'm hoping for a SQL type statement like: rDisconnRS3.Open "SELECT * FROM rDisconnRS1"
LVL 18

Accepted Solution

Sethi earned 200 total points
ID: 8031221
No its not possible to query a recordset. This is becuase when you run a SQL query the result returned by the server is a resultset (recordset). So recordset is a result of a query and its not possible to query it. However, you can use Filter property to achieve what you want. According to MSDN: "Filtering involves identifying all the records in a Recordset that meet a specified criteria. Although it might sound similar to finding records or fetching records, it is not. To fetch the records we use the SQL query and filtering is performed on the records already fetched i.e it comes after the SQL query has been used."
This is how we use Filter property:
NameOfTheRecordSet.Filter = Criteria
The criteria string has following format:
FieldName Operator Value (for example, "LastName = 'Smith'").
You can also create compound clauses by concatenating individual clauses with 'AND' 'Or' keywords. For example:
"LastName = 'Smith' AND FirstName = 'John'") OR (for example, "LastName = 'Smith' OR Age > 20").

Expert Comment

ID: 8901061
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Experts: Post your closing recommendations!  Who deserves points here?
LVL 49

Expert Comment

ID: 8983467
Moderator, my recommended disposition is:

    Accept Sethi's comment(s) as an answer.

DanRollins -- EE database cleanup volunteer

Featured Post

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question