Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old October 15th, 2003, 02:56 PM
Registered User
 
Join Date: Jun 2003
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default one record set multiple data sources

i am trying to populate one record set using the recordset.open method, but i want to populate it from 2 data sources, not just one (using two connections) ... the add/update record proceedure does not appear practical, is there a way to just name 2 data sources when opening the record set so ONE record set is created from the two different databases also USING two different sql statements for the data sources?? I am using asp 3.0 on windows 2000 server and multiple access databases which i basically want to do multiple database search on .... yielding one search result to then manipulate further ...

will appreceiate any advice ....
  #2 (permalink)  
Old October 17th, 2003, 12:50 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

AFAIK, there is no (easy) way to merge two Recordsets in ADO. You could do some complicated stuff by using AddNew on the first Recordset to add each record from the second Recordset. However, I think that will kill performance.

If you are able to get your data as ready as can be from the database (filtered, sorted, whatever), you could use the GetRows method of the Recordset to get your data from the Recordsets in a two-dimensional array. You can then merge these two arrays, and do some client side data manipulating (skipping duplicate records, sorting, whatever). Again, this won't be very fast, unless you're working with relatively small datasets.

I take it there is no way to merge the data in the database, so your ASP pages can retrieve data from just one connection? You could look into linking servers or databases to get your data from a single source. For example, in SQL Server, you may get away by using a UNION on two queries that retrieve data from two databases / SQL Servers.....

Hope this helps a bit,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple Datasets from multiple Data Sources SQL_Hacker Reporting Services 1 June 18th, 2008 02:25 PM
Fill the five record only adapter to data set bhasker_braj121 ADO.NET 0 July 16th, 2007 05:12 AM
Joining data from multiple data sources ClaesR BOOK: Professional SQL Server 2005 Reporting Services ISBN: 0-7645-8497-9 0 August 28th, 2006 09:30 AM
Query from multiple data sources billmedd BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 September 27th, 2004 10:46 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.