Selecting an ODBC Database at runtime
Posted: Sat Aug 14, 2010 2:10 pm
I struggling a little to come to terms with exactly how to select different external ODBC databases at runtime under Linux (I am not sure if this differs at all on windows, but I am using RH Linux).
The simplest scenario is this:
I have two Jade systems, one is dev and the other prod. I have several external sql databases accessed via ODBC, also a dev and prod instance.
I step through the ODBC wizard in Jade on my dev system and point the External Database at the development SQL DB.
At some point in my development cycle, I then extract the whole dev schema in Jade and DB and load it to my prod Jade system.
What I seem to have to do now is to step through the wizard again on my prod system to point the external DB at the production SQL to get the DSN to change otherwise, I end up trying to access my dev SQL.
This all seems resonable, but what I would like to be able to do is to change the external DB at runtime depending on whether I am dev or prod.
I had put all the details necessary to build the production and dev DSN's into an INI file and tried to modify the appropriate attributes on the external DB object at run time, but this seems to produce a variety of inconsistent results.
I guess my ultimate question is "Is it possible to change the DSN of an ODBC database at runtime without stepping through the wizard, and if so, what is the process that should be followed?"
Thanks
Roland
The simplest scenario is this:
I have two Jade systems, one is dev and the other prod. I have several external sql databases accessed via ODBC, also a dev and prod instance.
I step through the ODBC wizard in Jade on my dev system and point the External Database at the development SQL DB.
At some point in my development cycle, I then extract the whole dev schema in Jade and DB and load it to my prod Jade system.
What I seem to have to do now is to step through the wizard again on my prod system to point the external DB at the production SQL to get the DSN to change otherwise, I end up trying to access my dev SQL.
This all seems resonable, but what I would like to be able to do is to change the external DB at runtime depending on whether I am dev or prod.
I had put all the details necessary to build the production and dev DSN's into an INI file and tried to modify the appropriate attributes on the external DB object at run time, but this seems to produce a variety of inconsistent results.
I guess my ultimate question is "Is it possible to change the DSN of an ODBC database at runtime without stepping through the wizard, and if so, what is the process that should be followed?"
Thanks
Roland