ODBC "file DSN" work yet?
Posted: Mon Oct 15, 2012 6:22 pm
I'm using an ODBC connection to a Microsoft Access database. Using the ODBC Data Source Administrator [In Windows 7: Control Panels --> Administrative Tools --> Data Sources (ODBC)], I can create connections using either a "User DSN" or a "System DSN", and either will work with my LiveCode app. It seems, though, that the third option, "File DSN", is a better solution for deploying an app because the other two options don't work after the app is moved to another computer.
This post (http://forums.runrev.com/phpBB2/viewtopic.php?t=2382) suggests "File DSN" is supposed to work with LiveCode but didn't at the time of the post (2008). Has it been fixed yet?
There's another solution (http://forums.runrev.com/phpBB2/viewtopic.php?t=2441), and while I applaud the contributor, AndyP, for getting the job done, his solution, which involves editing the registry, is hideously unelegant given the existence of the "File DSN" method that's specifically designed to address this portability issue and would probably involve a whopping 1 line of code. Plus I believe AndyP's solution won't work unless the computer has administrative rights, which it won't in my deployment scenario.
So... What about this "File DSN" thing?
What I think I know: It's a portable file (as opposed to a registry entry, which is what "User DSNs" and "System DSNs" are), which you create using the ODBC Data Source Administrator. You then stick this file inside your application somewhere, and it provides the info needed to make the ODBC connection.
The problem is that no one seems to know how to tell LiveCode about the file. LiveCode knows how to find "User DSN" and "System DSN" information. We just have to figure out how to tell it: "Hey, look at this file when perusing the available ODBC data sources."
This post (http://forums.runrev.com/phpBB2/viewtopic.php?t=2382) suggests "File DSN" is supposed to work with LiveCode but didn't at the time of the post (2008). Has it been fixed yet?
There's another solution (http://forums.runrev.com/phpBB2/viewtopic.php?t=2441), and while I applaud the contributor, AndyP, for getting the job done, his solution, which involves editing the registry, is hideously unelegant given the existence of the "File DSN" method that's specifically designed to address this portability issue and would probably involve a whopping 1 line of code. Plus I believe AndyP's solution won't work unless the computer has administrative rights, which it won't in my deployment scenario.
So... What about this "File DSN" thing?
What I think I know: It's a portable file (as opposed to a registry entry, which is what "User DSNs" and "System DSNs" are), which you create using the ODBC Data Source Administrator. You then stick this file inside your application somewhere, and it provides the info needed to make the ODBC connection.
The problem is that no one seems to know how to tell LiveCode about the file. LiveCode knows how to find "User DSN" and "System DSN" information. We just have to figure out how to tell it: "Hey, look at this file when perusing the available ODBC data sources."