By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,392 Members | 1,507 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,392 IT Pros & Developers. It's quick & easy.

Can a recordset be used like a table name in an SQL statement?

P: 2
I'm wondering if a recordset can be used in place of a table name in an SQL statement. I would like to use a previously created recordset in my program as the source for another query.

Ex. select company from rst where company = "cb";
Aug 13 '07 #1
Share this Question
Share on Google+
4 Replies


Rabbit
Expert Mod 10K+
P: 12,396
I'm wondering if a recordset can be used in place of a table name in an SQL statement. I would like to use a previously created recordset in my program as the source for another query.

Ex. select company from rst where company = "cb";
Short answer no.

Long answer:
You can do subqueries. And you can call a query from a query. But you can't call a recordset created from code.
Aug 13 '07 #2

Scott Price
Expert 100+
P: 1,384
Have a look at this article: 'Persisting' a Recordset

The recordset itself can't be saved, but it can be saved to a file, then later referenced from the file...

Regards,
Scott
Aug 13 '07 #3

P: 2
Thanks to all. I thought this was the case.
Aug 13 '07 #4

Rabbit
Expert Mod 10K+
P: 12,396
Thanks to all. I thought this was the case.
Not a problem. On a related note, you can use the recordset's SQL and change the SQL of a query. You can then call on that query from another query. It achieves the same result as if you were to call the recordset.
Aug 14 '07 #5

Post your reply

Sign in to post your reply or Sign up for a free account.