SQL,DB's, and LiveCode
Posted: Wed Nov 13, 2013 10:23 pm
Hello everyone,
I know there is a "Database" forum, but I have come to know people in this forum and don't like making new friends
. I just started using databases with LiveCode have some nagging questions I can't find in the docs.
When setting up an ODBC connection to a database, the liveCode lesson: http://lessons.runrev.com/s/lessons/m/4 ... using-odbc
has you follow a bunch of steps to create an ODBC connection and add a new "Data Source" for the test database. As part of these steps, they require that you point to the database that you want to open.
1. Does this mean that you can only use this ODBC connection for this one database? If I wanted to create another ODBC connection for another database, would I have to do this again?
2. How can you query two databases that belong in different directories? I found that the following simple join query works if the two databases are in the same directory:
3. Any general pointers would also be appreciated regarding using LiveCode to interface to databases!
Thanks,
Tom
I know there is a "Database" forum, but I have come to know people in this forum and don't like making new friends

When setting up an ODBC connection to a database, the liveCode lesson: http://lessons.runrev.com/s/lessons/m/4 ... using-odbc
has you follow a bunch of steps to create an ODBC connection and add a new "Data Source" for the test database. As part of these steps, they require that you point to the database that you want to open.
1. Does this mean that you can only use this ODBC connection for this one database? If I wanted to create another ODBC connection for another database, would I have to do this again?
2. How can you query two databases that belong in different directories? I found that the following simple join query works if the two databases are in the same directory:
Code: Select all
SELECT a.ID,b.ID "&\
"FROM "&dB_aPath&".Table1 AS a "&\
"LEFT JOIN "&dB_bPath&".Table1 AS b "&\
"ON a.ID = b.ID
Thanks,
Tom