Index: driver/prepare.c =================================================================== --- driver/prepare.c (revision 912) +++ driver/prepare.c (working copy) @@ -231,7 +231,16 @@ /* first, set apd fields */ if (ValueType == SQL_C_DEFAULT) - ValueType= default_c_type(ParameterType); + { + ValueType= default_c_type(ParameterType); + /* + Access treats BIGINT as a string on linked tables. + The value is read correctly, but bound as a string. + */ + if (ParameterType == SQL_BIGINT && + (stmt->dbc->flag & FLAG_DFLT_BIGINT_BIND_STR)) + ValueType= SQL_C_CHAR; + } if (!SQL_SUCCEEDED(rc = stmt_SQLSetDescField(stmt, stmt->apd, ParameterNumber, SQL_DESC_CONCISE_TYPE, Index: driver/driver.h =================================================================== --- driver/driver.h (revision 912) +++ driver/driver.h (working copy) @@ -145,6 +145,11 @@ #define FLAG_MIN_DATE_TO_ZERO (1 << 25) /* Convert ODBC min date to 0000-00-00 on query */ #define FLAG_MULTI_STATEMENTS (1 << 26) /* Allow multiple statements in a query */ #define FLAG_COLUMN_SIZE_S32 (1 << 27) /* Limit column size to a signed 32-bit value (automatically set for ADO) */ +/* + When binding SQL_BIGINT as SQL_C_DEFAULT, treat it as a string + (automatically set for MS Access) see bug#24535 +*/ +#define FLAG_DFLT_BIGINT_BIND_STR (1 << 28) /* We don't make any assumption about what the default may be. */ #ifndef DEFAULT_TXN_ISOLATION Index: driver/connect.c =================================================================== --- driver/connect.c (revision 912) +++ driver/connect.c (working copy) @@ -153,6 +153,10 @@ */ if (GetModuleHandle("msado15.dll") != NULL) options|= FLAG_COLUMN_SIZE_S32; + + /* Detect another problem specific to MS Access */ + if (GetModuleHandle("msaccess.exe") != NULL) + options|= FLAG_DFLT_BIGINT_BIND_STR; #endif mysql_init(mysql);