Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Beginner
Aug 8, 1997

Creating Inner Joins In An Access Database

This seemingly undocumented SQL table qualification syntax might be useful to access an external table by using the 'IN' keyword. I had used this ability before, but kept having trouble with joins (probably due to my syntax) until I used the database path as a qualifier for the table. In this example I separated the four tables found in the Biblio database into their own databases and issued this query in an empty database:

 
        SELECT Authors.*
        FROM C:\VB3\Biblio1.Authors _
                INNER JOIN _
                (C:\VB3\Biblio2.MDB.Titles
        INNER JOIN _
                (C:\VB3\Biblio3.MDB.Publishers
        INNER JOIN _
                C:\VB3\Biblio4.MDB.[Publisher _
                Comments]
        ON Publishers.PubID = [Publisher _
                Comments].PubID) 
        ON Titles.PubID = Publishers.PubID) 
        ON Authors.Au_ID = Titles.Au_ID;




While this may not work on ODBC, it works perfectly with Access databases and overcomes the single external database ability with the 'IN' clause.

Mark P.
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date