User Name Password Register
DaniWeb IT Discussion Community
All
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
Reply
Join Date: Nov 2004
Posts: 1
Reputation: jkurzner is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
jkurzner jkurzner is offline Offline
Newbie Poster

Any way to combine two datasources into one recordset?

  #1  
Nov 19th, 2004
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
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jul 2004
Location: Sydney, Australia
Posts: 166
Reputation: Lafinboy is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 7
Lafinboy's Avatar
Lafinboy Lafinboy is offline Offline
Junior Poster

Re: Any way to combine two datasources into one recordset?

  #2  
Nov 22nd, 2004
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 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 ::

Reply With Quote  
Join Date: Feb 2005
Location: Los Angeles, CA
Posts: 86
Reputation: dexterz is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 2
dexterz dexterz is offline Offline
Junior Poster in Training

Re: Any way to combine two datasources into one recordset?

  #3  
Feb 4th, 2005
Yes you can. I've done it in my site by combining the 2 db queries and display into one. I used function for the other db and it work flawlessly.


Dexter
Last edited by kc0arf : Feb 4th, 2005 at 11:33 pm.
Reply With Quote  
Join Date: Feb 2005
Posts: 1
Reputation: asemerdjian is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
asemerdjian asemerdjian is offline Offline
Newbie Poster

Re: Any way to combine two datasources into one recordset?

  #4  
Feb 4th, 2005
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...>
Reply With Quote  
Join Date: May 2005
Posts: 1
Reputation: chandar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
chandar chandar is offline Offline
Newbie Poster

Re: Any way to combine two datasources into one recordset?

  #5  
May 25th, 2005
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.
Reply With Quote  
Join Date: May 2005
Posts: 1
Reputation: Camz is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
Camz Camz is offline Offline
Newbie Poster

Re: Any way to combine two datasources into one recordset?

  #6  
May 31st, 2005
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.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP Forum

All times are GMT -4. The time now is 10:35 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC