|
-
Mar 3rd, 2010, 12:15 PM
#1
Thread Starter
Lively Member
How to connect to multiple Database to query from each
I have two databases in a same sever of MS SQL Server 2005. Now I want to make query from tables of each database. How can I do this ? and how will connect to both databases at time to peform query in tables of both using UNION clause.
Nasreen
-
Mar 3rd, 2010, 12:25 PM
#2
Re: How to connect to multiple Database to query from each
Something like:
select top 1 * from Database..Table T1
join database..table T2 on T1.Key = T2.Key
-
Mar 3rd, 2010, 01:53 PM
#3
Re: How to connect to multiple Database to query from each
Thread moved to 'Database Development' forum (the 'VB6' forum is only meant for questions which don't fit in more specific forums)
-
Mar 6th, 2010, 06:06 AM
#4
Thread Starter
Lively Member
Re: How to connect to multiple Database to query from each
 Originally Posted by TysonLPrice
Something like:
select top 1 * from Database..Table T1
join database..table T2 on T1.Key = T2.Key
My problem is not in select query statement, but it is connection string. Can you please tell how the above query is run using Vb ADOBD Connection and ADODB recordset ?. What connection you may use to run this query ?
Nasreen
-
Mar 6th, 2010, 09:32 AM
#5
Re: How to connect to multiple Database to query from each
The connection string can only connect to one database.
As TysonLPrice used the fully qualified name for both databases, it does not matter which one you connect to - you just run the query in the usual way.
The problems you might get are based around the permissions within the database... if that happens, tell us the details of the problem.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|