Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using recordsets in a SELECT sql sentence

Status
Not open for further replies.

rvctips

Programmer
Jun 20, 2003
17
ES
Hi,


I'm very new in SQL and VBA, so maybe it's very simple, but I'm not being able to use one or more Recordsets in a SQL SELECT sentence.

Having 2 recordsets (I've them still opened) what I need is to relate them in a sql populating a new recordset....
...
rsOne
rsTwo

ssql="SELECT rsOne!Field1,rsOne!Field2,rsTwo!Field1 FROM rsOne,rsTwo WHERE rsOne!Field1=rsTwo!Field1"
rsThree.open cnn,,,adcmtext

But this gives me an error saying Microsoft Jet can't find rsOne object.

What I'm doing wrong?

Thanks for your help,

 
If memory serves, recordsets exist in memory and are not tables. Therefore, the recordset cannot queried like a table as you have tried. What you can do, is create a query (aka a view) and query that. I've tried to do what you are trying to do and have not been successful.

Hope this helps.

"If it's stupid but works, it isn't stupid."
-Murphy's Military Laws
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top