|
-
Jun 4th, 2003, 02:47 PM
#1
Thread Starter
Fanatic Member
Populate Recordset from 2 Databases
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
He who listens well, speaks well.
-
Jun 4th, 2003, 03:45 PM
#2
Frenzied Member
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
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Jun 4th, 2003, 04:04 PM
#3
Thread Starter
Fanatic Member
Is there a way to combine 2 recordsets to hold only distinct information and then sort it? Thanks, Jeremy
He who listens well, speaks well.
-
Jun 4th, 2003, 04:52 PM
#4
Frenzied Member
What exactly are you trying to do?
You can nest the recordsets and compare them as you progress through the records.
Being educated does not make you intelligent.
Need a weekend getaway??? Come Visit
-
Jun 4th, 2003, 05:31 PM
#5
Thread Starter
Fanatic Member
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
He who listens well, speaks well.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|