Tracing problems in ODBC

Occasionally you may experience problems with the ODBC driver or the SQL engine that requires help from your support personnel. Here information obtained from the client and/or server drivers can be invaluable where the issue is not a generic problem/restriction that can't be observed within a single table and example SQL query.

Server side tracing

As ODBC is client/server most of the work happens server side via the kiodbc and sql engines. To enable server side logging/tracing a debug version of kiodbc is required. These are available from the 'Resources for Developers' section of the KCML download area on https://www.adpdsionline.com. This should be installed following the installation instructions for a new install.

When you next logon to the server click the options button to expose this dialog:

Advanced connection dialog

In the section at the bottom you can enter a tracing level and the name of a filename on the server. The level controls how verbose the log will be. Even at the low setting it can be megabytes in size. This logging only affects the session you are logging into and other users of ODBC will not log though they may suffer a performance degradation due to the extra checks that a debug server performs. Choose a filesystem for the file that has plenty of free space.

Now, whenever you connect to the ODBC service or perform any queries, debug information will be created on the server within the log file. You will not want to run for long periods of time with the server as all queries now run slower, logged queries very much slower and it may expose a data security hole due to the detail and extent of the data stored within the log file.

Client side tracing

Client side tracing is also available, however this is often less important. But for completeness is outlined here. The client side ODBC executables have tracing support by default and, unlike the server side versions, this will not hinder performance unless tracing is actually enabled.

To enable client tracing you must first enable this within Windows. Select the windows control panel and then ODBC (Under Windows 2000 and XP it is located within Administrative Tools). Select the `Tracing' tab, enter a filename in the `logfile path' box, click on `Start Tracing Now', and then on OK to confirm changes:

Trace tab in ODBC administrator

You should return to this window and Stop tracing later on.

Client and server side tracing/logging are not mutually exclusive. One, either, or both methods can be utilised to track down a potential problem.