Configure an ODBC data source

Use this information to configure an ODBC data source.

It is strongly recommended that you reference the Connection string keywords topic before manually configuring connection options.

Use the following steps to add connection options to the odbc.ini file:

  1. Open the odbc.ini file on your workstation using a text editor. Refer to the output of odbcinst -j for the location of System and User Data Sources on your system.
  2. If there are multiple ODBC data sources in the odbc.ini file, locate the section in the file that contains the data source, that is the target for the connection options you are configuring.
  3. Add a new line after the last entry in the data source and enter the new connection option and its value.
    • The syntax is keyword = value.
    • For example, if you want to change the date format from its default of 5 (yyyy-mm-dd or *ISO), to 1 (mm/dd/yy or *MDY), you would add DFT = 1 in the new line.
  4. Repeat step 3 to add additional connection options to the data source.
  5. Save the odbc.ini file.
Figure 1. An example of a odbc.ini file DSN entry

[DSN]
Description = Example DSN
Driver = IBM i Access ODBC Driver
System = HostName
Note:
  1. Do not add multiple entries for the same connection option to the same section for a specific data source. This can lead to unpredictable behavior.
  2. Options specified by the application in the connection string override any options specified in the odbc.ini file.