|
-
Aug 23rd, 2000, 02:20 AM
#1
Thread Starter
New Member
I have an SQL for extracting data from 2 tables. However the 2 tables have a different connection each as they are located in different databases. This is easy in Microsoft Access but I can't figure it in VB. How can I create a connection/command that is able to extract data this way (if it is possible)?
-
Aug 23rd, 2000, 10:47 AM
#2
Fanatic Member
In SQL server when tables are in different databases you can reference them by the following syntax.
<server>..<table>.<field>
so a query would look like this for example:
"SELECT <Database1>..<table1>.<field1> , <field2> , <field3> FROM <Database1>..<table1> , <table2>"
field2 and field3 are in the same database - lets say database2 for demonstration purposes, field1 is on the same server but in database1. The connection is pointing at database2.
Hope this helps
-
Aug 23rd, 2000, 10:50 AM
#3
Frenzied Member
As long as the databases are on the same server....
Otherwise you'll need to do something like use Access to link to the tables, with your program reading the data from Access...
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
|