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

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.

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

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...> :)

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.

Member Avatar for Camz

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.