Skip to Main Content

DevOps, CI/CD and Automation

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

querying multiple Oracle tables via ADO Recordset..

trance77Feb 11 2002
I've been able to set up a simple SQL statement in my VB/VBA code that queries an Oracle8i 8.1.7 EE db via ADO.. it queries a test tbl with two columns and retrieve the data into my Recordset... no problem.
Now I want to be able to query multiple columns in multiple tables(i.e. SELECT a.major_equipment,b.location from A,B). I don't want to create mulitple recordsets for this.. which has been recommended. I'd like to put the queried data into my single recordset and use the NextRecordset method to traverse and put the data into a Word document table.
I've read on the technet that this will need to be done via a stored procedure of some sort because the Provider for Oracle OLE DB doesn't support this functionality. Is this correct? Below is the VB code I have so far..

Set Cnxn = New ADODB.Connection
strCnxn = "Provider=OraOLEDB.Oracle;Data Source=xxx;User Id=xxx;Password=xxx;"

Cnxn.Open strCnxn

Set rstCompound = New ADODB.Recordset

SQLcompound = "SELECT a.major_equipment,b.location from A,B"

rstCompound.Open SQLcompound, Cnxn, adOpenForwardOnly, adLockReadOnly, adCmdText

' To view recordset data
Debug.Print rstCompound.Fields("major_equipment").Value & _
rstCompound.Fields("location").Value



Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 11 2002
Added on Feb 11 2002
1 comment
521 views