Using the InterSystems ODBC Driver
Using an InterSystems Database as an ODBC Data Source on Windows
This chapter describes how to create a DSN for an InterSystems database on Windows, which you can do either via the Control Panel or by creating a file DSN.
To create a DSN, you can use the Windows ODBC Data Source Administrator to access the InterSystems ODBC Data Source Setup dialog box:
The following illustration shows an instance of the InterSystems ODBC Data Source Setup dialog box with all required fields filled in:
InterSystems ODBC Data Source Setup Dialog Box
The fields are listed below and are required unless otherwise specified:
Data Source and Connection sections
Specifies the user-defined name of the DSN.
Optional. Provides user-defined information about the DSN.
Host IP Address
Specifies the IP address to be used by the ODBC connection in dotted decimal or dotted quad form, such as “127.0.0.1”.
Host Port Number
Specifies the port to be used by the ODBC connection. The default for InterSystems is 51773.
Authentication Method section
Specifies the namespace to use as the ODBC data source.
Optional. Specifies the username to be used by the ODBC connection. By default, this is _SYSTEM
Optional. Specifies the password to be used by the ODBC connection. For the default username, the password is SYS
(must be all upper case).
Misc section (optional settings)
Optional. If selected, specifies the creation of a log file of ODBC client driver activities for all InterSystems DSNs. This log is for troubleshooting; you should not turn logging on during normal operation as it will dramatically slow down ODBC performance. See “ODBC Logging on Windows
” for more information.
Optional. If selected, enables the InterSystems ODBC client driver’s static cursor support. If this flag is off, then the cursor support provided by the ODBC Cursor Library will be used. In general, this flag should be off unless you have a specific reason for not using the ODBC Cursor Library.
Disable Query Timeout
Optional. If selected, causes the ODBC client driver to ignore the value of the ODBC query timeout setting.
The ODBC query timeout setting specifies how long a client should wait for a specific operation to finish. If an operation does not finish within the specified time, it is automatically cancelled. The ODBC API provides functions to set this timeout value programmatically. Some ODBC applications, however, hard-code this value. If you are using an ODBC application that does not allow you to set the timeout value and the timeout value is too small, you can use the Disable Query Timeout option to disable timeouts.
Use Locale Decimal Symbol
Optional. When selected, specifies the use of the current locale's decimal separator; not checking this sets the decimal separator in the process to a period ("."
) regardless of the locale. This value can have an affect when the ODBC connection is interoperating with an application that uses the decimal separator as defined for the current locale.
Unicode SQL Types
Optional. This functionality is only relevant if you are working with a multibyte character set, such as in Chinese, Hebrew, Japanese, or Korean locales. If you are only using single-byte character set data, do not select this check box. If selected, this option turns on reporting of a Unicode SQL type (SQL_WVARCHAR (-9) SQLType
) for string data. This allows some Microsoft applications to allocate the properly sized buffers to hold multibyte data.
After you have created the DSN, you can use the Test Connection
button to see if your data source is working correctly.
button attempts to ping the DSN host machine for the number of times specified in the #Times
field. A popup window will display information on ping success or failure.
Windows Power Shell Commands
Windows also offers a set of Power Shell commands for manipulating DSNs from the command line. For details, see the Power Shell documentation for Windows Data Access Components (WDAC).
On Windows 64-bit, use the Windows Control Panel ODBC Administrator to create user DSNs that function for both 32- and 64-bit programs. To configure a system DSN for a 32-bit program, run %SystemRoot%\SysWow64\odbcad32.exe
DSN information is typically stored in the Windows Registry (under [HKLM\SOFTWARE\ODBC]
), but you can also specify connection information in a file DSN
(a text file with extension .dsn
A file DSN can be created with either the ODBC Data Source Administrator (from the File DSN
tab) or a standard text editor. For detailed information, see the Microsoft support site
(search on "file DSN"
The file DSN can specify the name of an existing DSN to use, for example:
DSN=InterSystems ODBC Sample Code
or it can specify a set of key-value pairs that specify the same connection information as a standard registry entry.
takes a connection string argument that can specify connection information in three different ways:
Specifies the name of a regular DSN in the registry. For example:
Specifies a file DSN rather than a registry entry. For example:
Defines all connection information directly in the connection string. For example:
"Driver=InterSystems ODBC Driver;Host=127.0.0.1;Port=56772;Database=USER;UID=myUsername;PWD="
Content Date/Time: 2019-02-18 00:56:44