4. Configuring Switch
4.1 Configuring Switch user preferences
4.1.12 Switch preferences: ODBC data sources
This section of the Preferences dialog is only relevant if you have an active license for the
Databases module.
Property Description ODBC data
source
information Click database connection to set up the database connections. See on page 49. Setting up an ODBC
4.1.12.1 About ODBC data sources in Switch
Guidelines
Please take into account the following guidelines when accessing ODBC data sources in Switch: Before you set up the connection to the data source, you should have defined your database (i.e. the Database Source Name (DSN)) in the DSN settings of your operating system. Read the documentation of your database to learn how to set up the DSN.
Windows users can find more information on the Microsoft website: http://msdn.microsoft.com/ en-us/library/ms710252%28v=VS.85%29.aspx
Mac users should install an ODBC Administrator, for example http://www.odbcmanager.net/, to be able to set up ODBC connections on Mac.
Note: Switch allows you to use both User and System DSN on Windows and Mac platforms.
Make sure to install a 32 bit ODBC driver.
Even while running Switch on a 64 bit operating system, only 32 bit ODBC drivers can be used, as Switch is currently a 32 bit process.
• Example Windows OS: In case of MySQL database, the ODBC driver installer mysql-
connector-odbc-5.1.8-winx64.msi is used. When you launch this installer and choose the Custom installation, you will see that two drivers are available: 32 bit and 64 bit. Install the 32 bit driver and preferably disable the 64 bit driver, to avoid mix-up of driver versions in the future. This will guarantee that Switch uses the correct driver.
For more information on ODBC drivers and data sources, refer to http://msdn.microsoft.com/en- us/library/ms710285%28v=VS.85%29.aspx .
• Example Mac OS X: In the MySQL database, two versions of Mac OS X ODBC drivers are available: 32 bit and 64 bit. You must use the 32 bit version (mysql-connector- odbc-5.1.8-osx10.6-x86-32bit.dmg).
Make sure to use the 32 bit version of the ODBC Administrator tool to configure your data sources (DSNs).
On 64 bit Windows computers, two ODBC Administrator tools are available: • 32 bit version: ..\windows\sysWOW64\odbcad32.exe
• 64 bit version: ..\windows\system32\odbcad32.exe
Use the 32 bit version from \windows\sysWOW64\odbcad32.exe to configure your DSNs for Switch.
• If you install only the 32 bit ODBC driver and then launch the 64 bit version of the tool, you will not be able to configure any DSNs, because the 64 bit version of the tool does not show the 32 bit ODBC drivers.
• If you have installed the 64 bit ODBC drivers, then in the 64 bit version of the tool you will see the 64 bit driver and you will be able to configure DSNs for that driver. However, Switch will not work with these DSNs and you will get the error message The specified DSN contains an architecture mismatch between the Driver and
Application".
Note: The ODBC Administrator tool invoked from the Control Panel on Windows 64 bit OS is a 64 bit tool. Do not use this tool to configure DSNs for Switch.
For more information on managing data sources, refer to http://msdn.microsoft.com/en-us/ library/ms712362%28v=VS.85%29.aspx .
Using the INGRES database in combination with Switch?
You should set the following flag (in the INGRES database):
return NULL for SCHEMA columns in ODBC catalog function result sets
Otherwise, you will get an error ("invalid table") when setting up SQL statements.
4.1.12.2 Setting up an ODBC database connection
If you want to use Switch with an ODBC data source (and you have licensed the Database module), you must set up a connection to the preferred database.
Note: If you have more than one database, you can configure different database connections as required.
To configure an ODBC database connection
1. In Switch, navigate to Edit > User Preferences > ODBC data sources . 2. Do one of the following:
•
Select the ODBC data source information field and click . • Double-click the ODBC data source information field. The ODBC data sources dialog appears.
3.
To add and configure an ODBC data source, click .
The ODBC sources field now contains one data source, temporarily called Data Source. You can rename it in the next step of this procedure.
4. In the Properties pane, in the Data Source text field, provide a name for the data source. 5. In the Description text field, provide a small definition for the data source.
6.
To select the DSN (Database Source Name) from the library, click .
The DSN must be defined in the DSN settings of your operating system. For more information, refer to About ODBC data sources in Switch on page 48.
7. Provide a Username and Password.
These two fields can also be left blank if username and password are not required, or if they have already been defined for the DSN.
8. From the drop-down menus, select the appropriate Query codec and Data codec, if required. 9. To test the database connection, click Check connection.
If the connection succeeded, a message box appears displaying the message Connection successful.
Note: In case of problems, you will see an error message generated by the ODBC tool of your operating system.
10. To close the message, click OK.
If you have more than one database, repeat step 3 to 10 and add as many data sources as you have databases.
11. To close the ODBC data sources dialog, click OK once more.