Versions of the unixODBC release before version 2.2.14 have incorrectly implemented some aspects of the 64-bit ODBC specification as defined by Microsoft. These differences will cause problems when using the unixODBC driver manager with the SQL Anywhere 64-bit ODBC driver.
To avoid these problems, you should be aware of the differences. One of them is the definition of SQLLEN and SQLULEN. These are 64-bit types in the Microsoft 64-bit ODBC specification, and are expected to be 64-bit quantities by the SQL Anywhere 64-bit ODBC driver. Some implementations of unixODBC define these two types as 32-bit quantities and this will result in problems when interfacing to the SQL Anywhere 64-bit ODBC driver.
There are three things that you must do to avoid problems on 64-bit platforms.
Instead of including the unixODBC headers like sql.h and sqlext.h, you should include the SQL Anywhere ODBC header file unixodbc.h. This will guarantee that you have the correct definitions for SQLLEN and SQLULEN. The header files in unixODBC 2.2.14 or later versions correct this problem.
You must ensure that you have used the correct types for all parameters. Use of the correct header file and the strong type checking of your C/C++ compiler should help in this area. You must also ensure that you have used the correct types for all variables that are set by the SQL Anywhere driver indirectly through pointers.
Do not use versions of the unixODBC driver manager before release 2.2.14. Link directly to the SQL Anywhere ODBC driver instead. For example, ensure that the libodbc shared object is linked to the SQL Anywhere driver.
libodbc.so.1 -> libdbodbc16_r.so.1
Alternatively, you can use the SQL Anywhere driver manager on platforms where it is available.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0|