Print Page | Close Window

querying from more than 2 dbs

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5301
Printed Date: 29 March 2026 at 2:08am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: querying from more than 2 dbs
Posted By: simflex
Subject: querying from more than 2 dbs
Date Posted: 26 August 2003 at 8:58am

I have two different databases in two different servers.
How can I set up my dsn to query the two different databases?
For instance,
To make this below sample query:

select dbo.databaseName.tableName.fieldName,
theOtherdbo.otherDatabaseName.OtherTableName.otherFieldName
from dbo.databaseName.tableName,
theOtherdbo.otherDatabaseName.OtherTableName
where dbo.databaseName.tableName.key = theOtherdbo.otherDatabaseName.OtherTableName.key
how can I set up the dsn?
Thanks in advance




Replies:
Posted By: Bunce
Date Posted: 26 August 2003 at 4:03pm

You can't in a DSN.

First option is to link the servers on the server side. Assuming you're using SQL Server you can do it using sp_AddLinkedServer, or through Enterprise Manager under Security I think.

Second is to create two separate database connections and merge/link the two in code somehow.

Cheers,
Andrew



-------------
There have been many, many posts made throughout the world...
This was one of them.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net