diff --git a/ext/pdo_odbc/odbc_stmt.c b/ext/pdo_odbc/odbc_stmt.c index 042c4684a887..71d66fefdbfd 100644 --- a/ext/pdo_odbc/odbc_stmt.c +++ b/ext/pdo_odbc/odbc_stmt.c @@ -387,7 +387,10 @@ static int odbc_stmt_param_hook(pdo_stmt_t *stmt, struct pdo_bound_param_data *p } rc = SQLDescribeParam(S->stmt, (SQLUSMALLINT) param->paramno+1, &sqltype, &precision, &scale, &nullable); - if (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) { + if ( + (rc != SQL_SUCCESS && rc != SQL_SUCCESS_WITH_INFO) + || sqltype == SQL_UNKNOWN_TYPE + ) { /* MS Access, for instance, doesn't support SQLDescribeParam, * so we need to guess */ switch (PDO_PARAM_TYPE(param->param_type)) {