Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PO PO is offline
external usenet poster
 
Posts: 66
Default Merging two och more recordsets

Hi,

I want to join data from 2 different databases in one table and then put the
merged data in a spreadsheet.

I use 2 recordsets to get the data:

RS1 contains the following data: SELECT CustomerID, Name, Description FROM
Table X (in DB1)
RS2 contains the following data: SELECT CustomerID, Adress, Description FROM
Table Y (in DB2)

I now want to join RS1 with RS2 and put the result in RS3.

I suspect you could do something like this(?):

RS3.RecordSource=
SELECT
RS1!Name, RS2!Adress
FROM
RS1, RS2
WHERE
RS1.CustomerID=RS2.CustomerID

but I donīt know exacly how to do this.

Kind regards!

Peter Osswald


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Merging two och more recordsets

You need to do the join in the sql statement that creates the records set -
rather than creating two recordsets, create one recordset doing the join in
that sql statement.
--
Regards,
Tom Ogilvy

"PO" <po wrote in message ...
Hi,

I want to join data from 2 different databases in one table and then put

the
merged data in a spreadsheet.

I use 2 recordsets to get the data:

RS1 contains the following data: SELECT CustomerID, Name, Description FROM
Table X (in DB1)
RS2 contains the following data: SELECT CustomerID, Adress, Description

FROM
Table Y (in DB2)

I now want to join RS1 with RS2 and put the result in RS3.

I suspect you could do something like this(?):

RS3.RecordSource=
SELECT
RS1!Name, RS2!Adress
FROM
RS1, RS2
WHERE
RS1.CustomerID=RS2.CustomerID

but I donīt know exacly how to do this.

Kind regards!

Peter Osswald




  #3   Report Post  
Posted to microsoft.public.excel.programming
PO PO is offline
external usenet poster
 
Posts: 66
Default Merging two och more recordsets

1. Is it possible to join two tables from two different databases (one
Oracle database and one MS Access database) in one singel select statement??

2. Is it imposible to accomplish what I discribed below, that is, joining
two recordsets into one?

Regards,
Peter O

"Tom Ogilvy" wrote in message
...
You need to do the join in the sql statement that creates the records

set -
rather than creating two recordsets, create one recordset doing the join

in
that sql statement.
--
Regards,
Tom Ogilvy

"PO" <po wrote in message ...
Hi,

I want to join data from 2 different databases in one table and then put

the
merged data in a spreadsheet.

I use 2 recordsets to get the data:

RS1 contains the following data: SELECT CustomerID, Name, Description

FROM
Table X (in DB1)
RS2 contains the following data: SELECT CustomerID, Adress, Description

FROM
Table Y (in DB2)

I now want to join RS1 with RS2 and put the result in RS3.

I suspect you could do something like this(?):

RS3.RecordSource=
SELECT
RS1!Name, RS2!Adress
FROM
RS1, RS2
WHERE
RS1.CustomerID=RS2.CustomerID

but I donīt know exacly how to do this.

Kind regards!

Peter Osswald






  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Merging two och more recordsets

PO,

can you create a linked table in either one of the main databases?
then you can use 1 sql engine to do the work for you.

i dont see it happening the way you describe.


keepITcool

< email : keepitcool chello nl (with @ and .)
< homepage: http://members.chello.nl/keepitcool


"PO" <po wrote:

1. Is it possible to join two tables from two different databases (one
Oracle database and one MS Access database) in one singel select
statement??

2. Is it imposible to accomplish what I discribed below, that is,
joining two recordsets into one?

Regards,
Peter O

"Tom Ogilvy" wrote in message
...
You need to do the join in the sql statement that creates the records

set -
rather than creating two recordsets, create one recordset doing the
join

in
that sql statement.
--
Regards,
Tom Ogilvy

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Merging two och more recordsets

No, you couldn't do the single SQL since the recordsets belong to different
parents.

I don't know ADO well enough to say whether you could put each result in a
cursor and treat the cursor as two tables that could be joined, producing a
third recordset.

But, you could put each rs on a worksheet, then built a combined table/join
using the Vlookup function - if your looking for an immediate solution.

--
Regards,
Tom Ogilvy

"PO" <po wrote in message ...
1. Is it possible to join two tables from two different databases (one
Oracle database and one MS Access database) in one singel select

statement??

2. Is it imposible to accomplish what I discribed below, that is, joining
two recordsets into one?

Regards,
Peter O

"Tom Ogilvy" wrote in message
...
You need to do the join in the sql statement that creates the records

set -
rather than creating two recordsets, create one recordset doing the join

in
that sql statement.
--
Regards,
Tom Ogilvy

"PO" <po wrote in message

...
Hi,

I want to join data from 2 different databases in one table and then

put
the
merged data in a spreadsheet.

I use 2 recordsets to get the data:

RS1 contains the following data: SELECT CustomerID, Name, Description

FROM
Table X (in DB1)
RS2 contains the following data: SELECT CustomerID, Adress,

Description
FROM
Table Y (in DB2)

I now want to join RS1 with RS2 and put the result in RS3.

I suspect you could do something like this(?):

RS3.RecordSource=
SELECT
RS1!Name, RS2!Adress
FROM
RS1, RS2
WHERE
RS1.CustomerID=RS2.CustomerID

but I donīt know exacly how to do this.

Kind regards!

Peter Osswald








Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem displaying recordsets in Excel Format David Alexander Excel Discussion (Misc queries) 2 February 27th 06 04:52 PM
When merging information not merging correctly Bridgett Excel Worksheet Functions 0 December 9th 05 10:12 PM
Merging Beginner2005 Excel Discussion (Misc queries) 3 November 7th 05 01:53 PM
Sorting, Merging, and Re-merging Abi Excel Worksheet Functions 2 June 15th 05 08:21 PM
ADO Recordsets ibeetb Excel Programming 1 September 11th 03 11:12 PM


All times are GMT +1. The time now is 10:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Đ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"