Does anyone know how to create a recordset from another recordset? I need it for a drill down application where the initial SQL statement would be too long and complex.
For example, create a RS with all the states, then let the user pick a few states to keep and then dump those into a new recordset. Then let the user pick a few cities and dump that into a new recordset then let the user pick a few zipcodes and dump that into a new recordset.
The ultimate goal here is to end up with a recordset that can be bound to a report at run-time. I got the run-time report binding to work, I just can't figure out how to build a recordset from another recordset.
I'm thinking something like this:
SELECT * FROM <complex join> WHERE STATE IN(<whatever user selected>)
and save the result in RS1. Then for RS2 do something like this:
SELECT * FROM RS1 WHERE Cities IN(<whatever user selected>)
Then for RS3:
SELECT * FROM RS2 WHERE Zipcode IN(<whatever user selected>)
Then finally bind RS3 to a report and blow away RS1 and RS2.
I'm using ADO 2.1.
Thanks in advance,
Steve
tribesaddict@swbell.net
For example, create a RS with all the states, then let the user pick a few states to keep and then dump those into a new recordset. Then let the user pick a few cities and dump that into a new recordset then let the user pick a few zipcodes and dump that into a new recordset.
The ultimate goal here is to end up with a recordset that can be bound to a report at run-time. I got the run-time report binding to work, I just can't figure out how to build a recordset from another recordset.
I'm thinking something like this:
SELECT * FROM <complex join> WHERE STATE IN(<whatever user selected>)
and save the result in RS1. Then for RS2 do something like this:
SELECT * FROM RS1 WHERE Cities IN(<whatever user selected>)
Then for RS3:
SELECT * FROM RS2 WHERE Zipcode IN(<whatever user selected>)
Then finally bind RS3 to a report and blow away RS1 and RS2.
I'm using ADO 2.1.
Thanks in advance,
Steve
tribesaddict@swbell.net