Home | Previous Page | Next Page   Configuring Data Sources >

Configuring a DSN in Windows

In Windows environments, IBM Informix ODBC Driver provides a GUI to configure DSNs.

To configure a DSN:

For a description of values, see Table 5 and Table 6. Values are shown in the order that they appear in each section.

Tip:
To find out what kind of DSN you have, follow the steps ***, click the General tab and read the contents of the Description text box.
Tip:
You can also use Microsoft ODBC, Version 2.5 or later, to configure a DSN. To configure an existing DSN, see page ***.

Table 5. Required DSN Values
Required Values Description
Data Source Name DSN to access

This value is any name that you choose. Data Source Name is like an envelope that contains all relevant connection information about the DSN.

Database Name Name of the database to which the DSN connects by default
Host Name Computer on which Server resides
Protocol Protocol used to communicate with Server

Once you have added a DSN, the pull-down menu will display the available choices.

Server Name Informix database server on which Database resides
Service Informix database server process that runs on your Host computer

Confirm the service name with your system administrator or database administrator.

Table 6. Optional DSN Values
Optional Values Description
Client Locale Default value: en_us.1252
Database Locale Default value: en_us.1252
Description Any kind of information, such as version number and service
Options General information, such as password settings

For more information on this value, see the sqlhosts information in your IBM Informix: Administrator's Guide.

Password Password for access to the DSN
Translation Library Dynamic linked library (DLL) that performs code-set conversion; default value:
$INFORMIXDIR\bin\ig04n304.dll
User Id User identification or account name for access to the DSN
Translation Option Option for a non-IBM Informix translation library

Varying multibyte character length reporting option that specifies how to set pcbValue when rgbValue (the output area) is not large enough for the code-set-converted data

Possible values:

  • 0=Estimate
  • 1=Exact

Default value: 0

Cursor Behavior Flag for cursor behavior when a commit or rollback transaction is called

Possible values are:

  • 0=close cursor
  • 1=preserve cursor

Default value: 0

To configure a new user DSN or system DSN
  1. Choose Start > Settings > Control Panel.
  2. Double-click ODBC to open the ODBC Data Source Administrator dialog box.

    To configure a user DSN, go to step 3. To configure a system DSN, click the System DSN tab and go to step 3. All subsequent steps are the same to configure either a user DSN or a system DSN.

  3. Click Add.

    The Create New Data Source dialog box appears.

  4. Double-click INFORMIX 3.81 32 BIT on the Create New Data Source wizard.

    The General page for the IBM Informix ODBC Driver Setup dialog box appears.

  5. Enter the values in the General page, as the following example shows:
    • Data Source Name: odbc33int
    • Description: file DSN 3.81 on turbo

    For a description of the values, see Table 5 and Table 6.

    Important:
    Do not click OK after you enter the values on this page. If you click OK before you enter all the values, you get an error message.
  6. Click the Connection tab to display the Connection page and enter the values, as the following example shows:
    • Server Name: ol_clipper (or use the pull-down menu to choose a server that is on the sqlhosts registry. If you use the pull-down menu, the ODBC application sets the Host Name, Service, Protocol, and Options values.)
    • Host Name: clipper
    • Service: turbo
    • Protocol: olsoctcp (or use the pull-down menu to choose a protocol)
    • Options: csm=(SPWDCSM)
    • Database Name: odbc_demo (or use the pull-down menu to find a database name)
    • User Id: myname
    • Password: *******

      To save the values you chose and verify that your DSN connects successfully, click Apply & Test Connection. An ODBC Message dialog box appears. The box tells you if your connection was successful or, if it was not, tells you which Connection-tab value is incorrect.

  7. Click the Environment tab to display the Environment page and enter the values, as the following example shows:
    • Client Locale: en_US.CP1252
    • Database Locale: en_US.CP1252
    • Use Server Database Locale: if checkbox is checked, database locale value is set to the server locale. If the checkbox is unchecked, the database locale is set to the default locale, en_US.CP1252.
    • Translation Library: INFORMIXDIR\lib\esql\ig04n304.dll
    • Translation Option: 0
    • Cursor Behavior: 0 - Close
    • VMB Character: 0 - Estimate
    • Fetch Buffer Size: 4096
  8. Click the Advanced tab to display the Advanced page and click all applicable boxes.
    • Auto Commit Optimization

      This option defers automatic commit operations while cursors remain open and can reduce database communication when the application is using non-ANSI logging databases. This option is available only as a connection option:

      SQL_INFX_ATTR_OPTIMIZE_AUTOCOMMIT

      or as a connection attribute string:

      "OptimizeAutoCommit"

      The default is: 1 (enabled).

    • Open-Fetch-Close Optimization

      This option causes the driver to buffer the open, fetch, and close cursor messages to the server. In addition, this option eliminates one or more message round trips when you use SQLPrepare, SQLExecute, and SQLFetch statements to fetch data with a cursor. This option is available only as a connection option:

      SQL_INFX_ATTR_OPTOFC

      or as a connection attribute string:

      "OPTOFC"

      The default is: 0 (disabled).

    • Insert Cursors

      This option reduces the number of network messages sent to and from the server by buffering the inserted rows that are used with arrays of parameters and insert statements. This option can greatly improve the performance of bulk insert operations, and is available as both connection and statement options:

      SQL_INFX_ATTR_ENABLE_INSERT_CURSORS.

      or as a connection attribute string:

      "EnableInsertCursors"

      The default is: 0 (disabled).

    • Scrollable Cursor

      If this option is activated, IBM Informix ODBC Driver, Version 2.90, supports only scrollable, static cursors. This option is available only as a connection option:

      SQL_INFX_ATTR_ENABLE_SCROLL_CURSORS

      or as a connection attribute string:

      "EnableScrollableCursors"

      The default is: 0 (disabled).

    • Report KeySet Cursors

      This option causes the driver to report (through SQLGetInfo) that it supports forward-only, static, and keyset-driven cursor types, although the driver only supports forward-only and static cursors. When you set this option, the driver enables dynaset-type functions, such as Microsoft's Visual Basic. These functions require drivers that support keyset-driven cursor types. This option is also available as a connection attribute:

      SQL_INFX_ATTR_REPORT_KEYSET_CURSORS

      or as a connection attribute string:

      "ReportKeysetCursors"

      The default is: 0 (disabled).

    • Report Standard ODBC Types Only

      If you activate this feature, the driver causes SQLGetTypeInfo to map all occurrences of user-defined types (UDTs) as follows:

      Blob
      SQL_LONGVARBINARY
      Clob
      SQL_LONGVARBINARY
      Multiset
      SQL_C_CHAR/SQL_C_BINARY
      Set
      SQL_C_CHAR/SQL_C_BINARY
      List
      SQL_C_CHAR/SQL_C_BINARY
      Row
      SQL_C_CHAR/SQL_C_BINARY

      The driver maps multiset, set, row, and list data types to SQL_C_CHAR or SQL_C_BINARY, which is the default UDT

      FetchType to SQL_C_CHAR features.

      The default is: 0 (disabled).

    • Describe decimal floating point as SQL_REAL / SQL_DOUBLE

      This option describes all floating-point decimal columns as Float (SQL_REAL or SQL_DOUBLE). A floating-point decimal column is a column that was created without a scale, ex: DECIMAL(12). Some prepackaged applications such as Visual Basic can not properly format Decimal columns that do not have a fixed scale. To use these applications you must enable this option or re-define the column with a fixed scale.

      There is a disadvantage to enabling this option however, SQL_DECIMAL is an exact numeric data type while SQL_REAL and SQL_DOUBLE are approximate numeric data types. A SQL_DECIMAL with a precision of 8 or less will be described as SQL_REAL, with a precision greater than 8 it is SQL_DOUBLE.

      The default is: 0 (disabled).

    • Do not use LVARCHAR

      Causes SQLGetTypeInfo to not report LVARCHAR as a supported type of DATA_TYPE of SQL_VARCHAR.

      Some applications such as MS Access97 will use LVARCHAR instead of VARCHAR even for columns that are less than 256 bytes long. The minimum number of bytes transmitted for LVARCHAR is higher than for Varchar and a large number of LVARCHAR columns can result in the rowset size exceeding the maximum. Enable this option only if your SQL_VARCHAR columns are less than 256 bytes in length.

      The default is: 0 (disabled)

    • Report CHAR Columns As Wide CHAR Columns

      Causes SQLDescribeCol to report char columns as wide char columns. SQL_CHAR column is reported as SQL_WCHAR, SQL_VARCHAR as SQL_WVARCHAR and SQL_LONGVARCHAR column as SQL_WLONGVARCHAR

      The default is: 0 (disabled)

  1. To check your connection to the database server, click Test Connection.
  2. Click OK to return to the ODBC Data Source Administrator dialog box and to update the DSN information in the appropriate files.

When your application connects to this DSN, the values that you entered are the default entries for the DSN connection.

To remove a DSN
  1. Follow steps 1 and 2 ***.
  2. Click Remove in the ODBC Data Source Administrator dialog box.

    The 32-bit ODBC Administrator dialog box appears.

  3. Click Yes to remove the DSN and return to the ODBC Data Source Administrator dialog box.
To reconfigure an existing DSN
  1. Follow steps 1 and 2 ***.
  2. Click Configure to display the IBM Informix ODBC Driver Setup dialog box.

    Enter the new configuration values in the corresponding text boxes and click OK to return to the ODBC Data Source Administrator dialog box.

After you complete these steps, you will connect to the DSN.

To configure a file DSN
  1. Choose Start > Settings > Control Panel.
  2. Double-click the ODBC icon to open the ODBC Data Source Administrator dialog box.
  3. Click the File DSN tab to display the File DSN page.

    Choose the File DSN option to allow access to the DSN to all users on a network. For a description of values, see Table 5 and Table 6.

  4. Click Add.

    The Create New Data Source wizard appears.

  5. Select INFORMIX 3.81 32 BIT from the driver list and click Next to display the Create New Data Source Setup wizard, which contains a file data source text box.
  6. If you know the name of the date source file, type the name into the text box, click Next to display the completed Create New Data Source wizard, and go to Step 9.

    If you do not know the name of the file, click Browse to display the Save As dialog box and enter the values, as the following example shows:

    • File Name: File_DSN
    • Save as type: ODBC File Data Sources

    Select a filename or type a filename in the File_name text box.

  7. Click Save to display the Create New Data Source wizard, which displays information about the data source name.
  8. Click Next to display the completed Create New Data Source wizard.
  9. Click Finish to display the IBM Informix Connect dialog box. For a description of the values, see Table 5 and Table 6. For Advanced tab values, see page 8.
  10. Click OK to save the values and display the ODBC Data Source Administrator dialog box.

    The name of the data file that you chose or typed in step 6 appears in the text box.

After you add or change DSN-configuration information, the driver updates the appropriate Windows registry to reflect the specified values. To be compatible with other IBM Informix connectivity products, the driver stores the DSN-configuration information in the Windows registry.

To create logs of calls to the drivers
  1. Click the Tracing tab to display the Tracing page, as Figure 5 shows.
    Figure 5. Tracing Page
    This graphic is a screenshot of the ODBC Data Administrator dialog box. The screenshot shows the Tracing tab. There are three sections in this tab. The first section contains two option buttons underneath the heading "When to Tract." The buttons are labeled "Start Tracing Now" and "Start Visual Studio Analysis," respectively. The "start Tracing Now button is highlighted. The second section is composed of two fields with browse features. The first field is called "log To Path" and the second field is called "Custom Trace DLL." The last section is an informational field that describes the choice that you have selected.
  2. Select Start Tracing Now to turn tracing on.
  3. To enter an existing log file, click Browse to display the Select ODBC Trace File dialog box.
  4. Enter the filename in the File_name text box and click Save to return to the Tracing page.
  5. To select a custom trace dynamic link library (DLL), click Select DLL to display the Select a custom trace dll dialog box, and enter the values, as the following example shows:
    • File name: test2_dsn
    • Files of type: Dynamic link libraries(*.dll)

    Choose a file or type a filename in the File_name text box.

  6. Click Open to display the Tracing page.
  7. Click OK to save the changes.

After you complete these steps, you will connect to the DSN.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]