I am having trouble creating a recordset that gets records from two different tables in two different databases. I'm using Oracle 8i and I have tried everything. Has someone tried this and been successful and if so, could you help? Thanks, Jeremy
Printable View
I am having trouble creating a recordset that gets records from two different tables in two different databases. I'm using Oracle 8i and I have tried everything. Has someone tried this and been successful and if so, could you help? Thanks, Jeremy
2 connectionStrings
2 Recordsets
VB Code:
Dim conn1 As ADODB.Connection Dim conn2 As ADODB.Connection Dim rs1 As ADODB.Recordset Dim rs2 As ADODB.Recordset Dim sql1 As String Dim sql2 As String Set conn1 = 'your first ConnectionString Set conn2 = 'your second ConnectionString Set sql1 = "SELECT * FROM TableName" Set sql2 = "SELECT * FROM TableName" rs1.Open(sql1, conn1, 3, 3) rs2.Open(sql2, conn2, 3, 3) do until rs1.eof 'do whatever rs1.movenext loop do until rs2.eof 'do whatever rs2.movenext loop conn1.close conn2.close rs1.close rs2.close Set conn1 = Nothing Set conn2 = Nothing Set rs1 = Nothing Set rs2 = Nothing Set sql1 = Nothing Set sql2 = Nothing
Is there a way to combine 2 recordsets to hold only distinct information and then sort it? Thanks, Jeremy
What exactly are you trying to do?
You can nest the recordsets and compare them as you progress through the records.
I have just figured out a workaround. Since I can't have one recordset from two different databases, no matter how hard I try, I just worked around it. I had to populate a ComboBox with records from two tables in two different databases. I didn't want duplicates. I figured it out though. Thanks, Jeremy