Beginning with Windows Server 2003, Microsoft operating systems have supported the 64-bit ODBC libraries. The ODBC headers and libraries first shipped with MDAC 2.7 SDK contain changes to allow programmers to easily write code for the new 64 bit platforms. By ensuring that your code uses the ODBC defined types listed below, you can compile the same source code both for 64-bit and 32-bit platforms based on the _WIN64 or WIN32 macros.
There are several points to keep in mind when programming for a 64-bit processor:
The following ODBC function calls take as an input parameter a pointer to a buffer in which data is returned from the driver. The context and meaning of the data returned is determined by other input parameters for the functions. In some cases, these methods may now return 64-bit (8-byte integer) values instead of the typical 32-bit (4-byte) integer values. These cases are as follows:
SQLColAttribute
When the FieldIdentifier parameter has one of the following values, a 64-bit value is returned in *NumericAttribute:
SQL_DESC_DISPLAY_SIZE
SQL_DESC_LENGTH
SQL_DESC_OCTET_LENGTH
SQL_DESC_COUNT
SQLColAttributes
When the fDescType parameter has one of the following values, a 64-bit value is returned in *pfDesc:
SQL_COLUMN_DISPLAY_SIZE
SQL_COLUMN_LENGTH
SQL_COLUMN_COUNT
SQLGetConnectAttr
When the Attribute parameter has one of the following values, a 64-bit value is returned in Value:
SQL_ATTR_QUIET_MODE
SQLGetConnectOption
When the Attribute parameter has one of the following values, a 64-bit value is returned in Value:
SQL_ATTR_QUIET_MODE
SQLGetDescField
When the FieldIdentifier parameter has one of the following values, a 64-bit value is returned in *ValuePtr:
SQL_DESC_ARRAY_SIZE
SQL_DESC_BIND_OFFSET_PTR
SQL_DESC_INDICATOR_PTR
SQL_DESC_OCTET_LENGTH_PTR
SQL_DESC_ROWS_PROCESSED_PTR
SQLGetDiagField
When the DiagIdentifier parameter has one of the following values, a 64-bit value is returned in *DiagInfoPtr:
SQL_DIAG_CURSOR_ROW_COUNT
SQL_DIAG_ROW_COUNT
SQL_DIAG_ROW_NUMBER
SQLGetInfo
When the InfoType parameter has one of the following values, a 64-bit value is returned in *InfoValuePtr:
SQL_DRIVER_HENV
SQL_DRIVER_HDBC
SQL_DRIVER_HLIB
When InfoType has either of the following 2 values *InfoValuePtr is 64-bits on both input and ouput:
SQL_DRIVER_HSTMT
SQL_DRIVER_HDESC
SQLGetStmtAttr
When the Attribute parameter has one of the following values, a 64-bit value is returned in *ValuePtr:
SQL_ATTR_APP_PARAM_DESC
SQL_ATTR_APP_ROW_DESC
SQL_ATTR_FETCH_BOOKMARK_PTR
SQL_ATTR_IMP_PARAM_DESC
SQL_ATTR_IMP_ROW_DESC
SQL_ATTR_MAX_LENGTH
SQL_ATTR_MAX_ROWS
SQL_ATTR_PARAM_BIND_OFFSET_PTR
SQL_ATTR_PARAM_OPERATION_PTR
SQL_ATTR_PARAM_STATUS_PTR
SQL_ATTR_PARAMS_PROCESSED_PTR
SQL_ATTR_PARAMSET_SIZE
SQL_ATTR_ROW_ARRAY_SIZE
SQL_ATTR_ROW_BIND_OFFSET_PTR
SQL_ATTR_ROW_NUMBER
SQL_ATTR_ROW_OPERATION_PTR
SQL_ATTR_ROW_STATUS_PTR
SQL_ATTR_ROWS_FETCHED_PTR
SQL_ATTR_KEYSET_SIZE
SQLGetStmtOption
When the Option parameter has one of the following values, a 64-bit value is returned in *Value:
SQL_MAX_LENGTH
SQL_MAX_ROWS
SQL_ROWSET_SIZE
SQL_KEYSET_SIZE
SQLSetConnectAttr
When the Attribute parameter has one of the following values, a 64-bit value is passed in Value:
SQL_ATTR_QUIET_MODE
SQLSetConnectOption
When the Attribute parameter has one of the following values, a 64-bit value is passed in Value:
SQL_ATTR_QUIET_MODE
SQLSetDescField
When the FieldIdentifier parameter has one of the following values, a 64-bit value is passed in *ValuePtr:
SQL_DESC_ARRAY_SIZE
SQL_DESC_BIND_OFFSET_PTR
SQL_DESC_INDICATOR_PTR
SQL_DESC_OCTET_LENGTH_PTR
SQL_DESC_ROWS_PROCESSED_PTR
SQLSetStmtAttr
When the Attribute parameter has one of the following values, a 64-bit value is passed in *ValuePtr:
SQL_ATTR_APP_PARAM_DESC
SQL_ATTR_APP_ROW_DESC
SQL_ATTR_FETCH_BOOKMARK_PTR
SQL_ATTR_IMP_PARAM_DESC
SQL_ATTR_IMP_ROW_DESC
SQL_ATTR_MAX_LENGTH
SQL_ATTR_MAX_ROWS
SQL_ATTR_PARAM_BIND_OFFSET_PTR
SQL_ATTR_PARAM_OPERATION_PTR
SQL_ATTR_PARAM_STATUS_PTR
SQL_ATTR_PARAMS_PROCESSED_PTR
SQL_ATTR_PARAMSET_SIZE
SQL_ATTR_ROW_ARRAY_SIZE
SQL_ATTR_ROW_BIND_OFFSET_PTR
SQL_ATTR_ROW_NUMBER
SQL_ATTR_ROW_OPERATION_PTR
SQL_ATTR_ROW_STATUS_PTR
SQL_ATTR_ROWS_FETCHED_PTR
SQL_ATTR_KEYSET_SIZE
SQLSetStmtOption
When the Option parameter has one of the following values, a 64-bit value is passed in *Value:
SQL_MAX_LENGTH
SQL_MAX_ROWS
SQL_ROWSET_SIZE
SQL_KEYSET_SIZE