How Do I Use ODBC? (Magic xpi 3.x)
Magic xpi lets you access data from various database management systems using ODBC data sources. To access database data with an ODBC data source, you should configure a compatible ODBC driver. You set up drivers for User or System data sources in Windows’® ODBC Data Source Administrator. You can configure one or both types of data sources for a project.
Configuring ODBC has three principal stages:
-
Stage 1: Adding an ODBC data source
-
Stage 2: Verifying its driver compatibility
-
Stage 3: Setting up ODBC in Magic xpi
To add an ODBC Data Source, do the following:
-
From the Windows Start menu, click Control Panel, and then double-click the Administrative Tools icon.
-
Double-click the Data Sources (ODBC) icon to open the ODBC Data Source Administrator window.
-
Click the…
-
User DSN tab to make the data only visible to you and only usable on the current machine, or
-
System DSN tab to make the data visible to all users on the current machine.
-
Click Add.
-
Select an appropriate driver for which you want to set up a data source, and then click Finish.
-
In the ODBC setup wizard, enter your information.
Use the Mgchkdrv.exe utility to perform a Magic xpi compatibility test.
-
In the Magic xpi\Gateways folder, double-click on Mgchkdrv.exe.
-
Click the Select Data Source button.
-
Click the Machine Data Source tab, select the DSN that you created earlier, and then click OK.
The utility will perform the test and display the results along with the log.
If the test fails, the ODBC driver is not compatible with Magic xpi.
These steps show how to set up the ODBC gateway with Magic xpi.
-
Open Magic xpi Studio. On the Project menu, click Resources to open the Resource Repository.
-
Create a new Database resource.
-
From the DBMS field, select the ODBC option, and then click OK. Provide the DSN in the Data Source Name and User/Password if required.
-
Click Validate to check that a connection was established successfully and then click OK to finish.
You will now be able to use the ODBC database as your Data Mapper service Source or Destination.
If you get an Unknown database error message, then enable the ODBC gateway in the Magic.ini file as follows:
-
Close all applications that are part of the Magic xpi Suite. These include the Magic xpi Studio, Magic xpi Monitor, Magic xpi Server, and uniPaaS.
-
Open the Magic.ini file located in the Magic xpi installation folder.
-
Find the [Magic_Gateways] section.
-
Go to the ;MGDB19=mgodbc.dll line and remove the semicolon (;) at the beginning of the line.
-
After the equal sign (=) add the following path \Magic xpi\Gateways\<name of .dll file>.
Note:
|
The .dll file you chose to use should be one that is found in the Magic xpi/Gateways folder.
|
|
-
Save and close the Magic.ini file.
-
Re-open your Magic xpi Suite.