Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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
 
Old February 25th, 2004, 03:54 PM
Authorized User
 
Join Date: Feb 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default Mutltiple database

I am trying to connect to a multiple database at the same time how can I do it ?

 
Old February 25th, 2004, 04:06 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You'll have to create different Connections using different connection strings for this to work. You'll end up with isolated recordsets that you can't combine or connect to each other.

Other than that, things will work the way they work with one connection for one database.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 25th, 2004, 06:36 PM
Friend of Wrox
 
Join Date: Sep 2003
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

I thought it was possible to perform a union query across two different databases.

 
Old February 25th, 2004, 06:38 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Not directly from an ASP page, AFAIK.

What you could do in SQL Server is connect to multiple Servers / Databases from within a Stored Procedure. Is that what you're referring to?

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
 
Old February 25th, 2004, 09:57 PM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

A database query to an MS-SQL server database can call two databases in either a straight text query or from within a stored procedure as long as the two databases reside on the same server. If the databases are on two different database servers then you have to apply some additional techniques like linked servers.

The query you use must simply reference the other database explicitly:

SELECT t1.field, t2.field
FROM Database1..Table AS t1, Database2..Table AS t2

Peter
------------------------------------------------------
Work smarter, not harder.
 
Old March 4th, 2004, 07:06 PM
Authorized User
 
Join Date: Feb 2004
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

can you please explain how your code works Peter






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem to restore database in C#2005 database acmuralee MySQL 0 March 25th, 2008 04:42 AM
Access database database format itHighway Access 0 February 24th, 2008 06:34 PM
Microsoft JET Database Database Engine (0x80040E09 cannielynn0312 Classic ASP Professional 2 December 17th, 2007 02:50 AM
Copying Table From one Database To Anoter Database jayanth_nadig VB Databases Basics 1 June 19th, 2006 02:39 PM





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