--- src\sql\drivers\odbc\qsql_odbc.cpp.orig 2014-04-16 21:12:28.000000000 +0200 +++ src\sql\drivers\odbc\qsql_odbc.cpp 2014-05-23 11:35:28.349418500 +0200 @@ -627,6 +627,22 @@ else if (nullable == SQL_NULLABLE) f.setRequired(false); // else we don't know + // Check for auto-increment + SQLLEN nNumericAttribute; + nNumericAttribute = 0; + r = ::SQLColAttribute(p->hStmt, + i + 1, + SQL_DESC_AUTO_UNIQUE_VALUE, + NULL, + 0, + NULL, + &nNumericAttribute); + if ((r != SQL_SUCCESS) && (r != SQL_SUCCESS_WITH_INFO)) + { + qSqlWarning(QString::fromLatin1("qMakeField: Unable to get autovalue attribute for column %1").arg(i), p); + } + else + f.setAutoValue(nNumericAttribute != SQL_FALSE); return f; }