The odbccmpt utility enables or disables the compatibility option for an ODBC application executable file.
odbccmpt file_name [/v:version_number] [/P] [/T] [/R] [/d]
The 6.5/7.0 ODBC compatibility option sets certain behaviors of the 3.7 SQL Server ODBC driver to be compatible with earlier SQL Server ODBC drivers. This is only needed when using the 3.7 SQL Server ODBC driver and connecting to an instance of SQL Server 2000 using applications developed with earlier versions of the SQL Server ODBC driver. The 6.5/7.0 ODBC compatibility option can be turned on for applications using either the ODBC 2.x or ODBC 3.x API.
odbccmpt does not need to be run for applications connecting to earlier versions of SQL Server using the 3.7 SQL Server ODBC driver. The 3.7 driver automatically runs in compatibility mode when it connects to earlier versions of SQL Server. odbccmpt does not need to be run for applications using earlier versions of the SQL Server ODBC driver connecting to SQL Server 2000. SQL Server 2000 automatically treats any application using the earlier drivers as a 6.5 or 7.0-level application.
Enabling the 6.5 ODBC compatibility option for an application causes the application to be treated as a 6.5-level application. The setting enables these changes in the behavior of the 3.7 SQL Server ODBC driver when it connects to an instance of SQL Server 2000:
This truncation may affect additional operations, such as preventing SQLSetPos updates referencing text and image columns.
Catalog results show all bit columns as NOT NULL because bit columns did not support null values in SQL Server 6.5.
If 7.0 compatibility is set, the server will communicate with the ODBC driver using 7.0 protocol. This means that the performance enhancements included in the prepare/execute model will not used. All new data types introduced with SQL Server 2000 (for example, sql_variant and bigint) will be converted to the closest matching type that the 7.0 driver supports.
The ODBC compatibility option can only be set at the level of an executable file. It cannot be set for individual DLLs.
When odbccmpt is run to enable the 6.5 ODBC compatibility option, it creates a registry key:
HKEY_LOCAL_MACHINE
SOFTWARE
Microsoft
MSSQLServer
Client
ODBCAppCompat
file_name:REG_SZ:6.5
When odbccmpt is run with the -d parameter, this key is removed. No error message is returned if odbccmpt is run with the -d parameter and there is no registry key for file_name.
Whenever the 3.7 SQL Server ODBC driver connects to SQL Server 2000, it checks the registry for a key matching the name of the executable file for the application. If a match is found, the driver enables the 6.5 ODBC compatibility option. If no match is made, the 6.5 ODBC compatibility option is not enabled.
Note Most ODBC applications can switch without change from the 2.65 SQL Server ODBC driver to the 3.7 driver. odbccmpt is a migration aid to assist with moving applications from SQL Server 6.5 to SQL Server 2000. It should be used only for applications having problems in moving to SQL Server 2000 and the 3.7 SQL Server ODBC driver. odbccmpt should only be used until the application has been corrected.
For information about where to find or how to run this utility, see Getting Started with Command Prompt Utilities.
odbccmpt MyApp /T
odbccmpt MyApp /v:6
odbccmpt MyApp /T /d