Search code examples
exceladosqlrecordsetvba

Run a SQL query on existing recordset?


I've created a 3rd recordset (disconnected) from two existing recordsets that came from different connections.

Now, I'd like to run a SQL query on this 3rd recordset.

I am using Excel VBA.

thanks, Harry


Solution

  • You can use the ADO RecordSet Filter method with SQL where clauses: Filter and RecordCount Properties Example, e.g.

    rs.Filter = "SupplierID = 10"