•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP section within the Web Development category of DaniWeb, a massive community of 426,882 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,284 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP advertiser: Lunarpages ASP Web Hosting
Views: 14002 | Replies: 5
![]() |
•
•
Join Date: Nov 2004
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Is there there any way to combine the results of two queries into two different recordsets into a single one? I have two different databases that have the same type of information in them, but are for different clients. It's nor practical at this time to rewrite all the asp code to use a single database and client identifier. All I want to do is query and combine. I do not need to perform any updates.
Thanks for any help.
Jeff
Thanks for any help.
Jeff
•
•
Join Date: Jul 2004
Location: Sydney, Australia
Posts: 166
Reputation:
Rep Power: 5
Solved Threads: 7
You may be better off performing the merge in one of the databases as a UNION query if that is feasible.
If not then you can assign both of the recordsets to an array and then merge the arrays. It will require that the structure of both tables is very similar, otherwise you will need to perform parsing functions to structure the data.
A third option would be to write the data from both recordsets to an xml file. Again that would require a structured format to the data, but would be more flexible than the array method.
If not then you can assign both of the recordsets to an array and then merge the arrays. It will require that the structure of both tables is very similar, otherwise you will need to perform parsing functions to structure the data.
A third option would be to write the data from both recordsets to an xml file. Again that would require a structured format to the data, but would be more flexible than the array method.
If I've been a help please confirm by clicking the Add to Lafinboy's Reputation link in the header of this reply.
Lafinboy Productions
:: Website Design :: Website Development ::
Lafinboy Productions
:: Website Design :: Website Development ::
•
•
Join Date: Feb 2005
Location: Los Angeles, CA
Posts: 86
Reputation:
Rep Power: 4
Solved Threads: 2
•
•
Join Date: Feb 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Jeff,
i am a newbie myself to asp, but you could probally try this. Create a access database, and create links within tables to the other database, let it be another accesss db, sql, oracle, etc... You can also recreate your queries by importing.
And use the new db to cross db's from one.
let me know how this goes, curious?
-allen
haha, <I didnt see this was an old post...>
i am a newbie myself to asp, but you could probally try this. Create a access database, and create links within tables to the other database, let it be another accesss db, sql, oracle, etc... You can also recreate your queries by importing.
And use the new db to cross db's from one.
let me know how this goes, curious?
-allen
haha, <I didnt see this was an old post...>
•
•
Join Date: May 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Is there there any way to combine the results of two queries into two different recordsets into a single one? I have two different databases that have the same type of information in them, but are for different clients. It's nor practical at this time to rewrite all the asp code to use a single database and client identifier. All I want to do is query and combine. I need to perform any updates.
Thanks for any help.
Chandar.
Thanks for any help.
Chandar.
•
•
Join Date: May 2005
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
You might want to try creating a temporary table - sort of like a shopping cart session table.
To do this, you need to make a separate connection to each of the two tables to SELECT your data, then INSERT the data from both, one after the other, into a "temp" table with an additional column for "session" identification to prevent accessing another users data.
Make sure that the users session data is inserted into every row of the temp table next to all of the other data.
Next, SELECT data from the new temp table for your combined data - which has been created and combined specifically for the users session.
Your next challenge will be to clear the temporary data on the expiration of a session, on a logout, or on the users next login.
Even if the columns are different in the two original tables, you can add them to a new table designed specifically to take them both.
This might sound like a lot to do, but it actually isn't.
To do this, you need to make a separate connection to each of the two tables to SELECT your data, then INSERT the data from both, one after the other, into a "temp" table with an additional column for "session" identification to prevent accessing another users data.
Make sure that the users session data is inserted into every row of the temp table next to all of the other data.
Next, SELECT data from the new temp table for your combined data - which has been created and combined specifically for the users session.
Your next challenge will be to clear the temporary data on the expiration of a session, on a logout, or on the users next login.
Even if the columns are different in the two original tables, you can add them to a new table designed specifically to take them both.
This might sound like a lot to do, but it actually isn't.
![]() |
•
•
•
•
•
•
•
•
DaniWeb ASP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- onclick dropdown event (ASP.NET)
- Execute from Sparc Solaris, retrieve a recordset from VB application running on WIN2K (C++)
- "ADODB Recordset error" (ASP)
- How to combine ".bin movies" in Mac? (OS X)
Other Threads in the ASP Forum
- Previous Thread: Microsoft VBScript runtime (0x800A0035)
- Next Thread: ASP / vb6 dll


Linear Mode