I get a [Microsoft][ODBC Microsoft Access Driver] Syntax error in CONSTRAINT clause. QODBC3: Unable to execute statement

with the following:
QString connection = "Driver={Microsoft Access Driver (*.mdb, *.accdb)};DSN='';DBQ=%1";
QSqlDatabase db = QSqlDatabase::addDatabase("QODBC3", connectionName);

db.setConnectOptions("SQL_ATTR_ACCESS_MODE=SQL_MOD E_READ_WRITE");
db.setConnectOptions("SQL_ATTR_ODBC_VERSION=SQL_OV _ODBC3");
db.setDatabaseName(connection .arg(databaseName));

QSqlQuery query(db);

QString sql = "CREATE TABLE Color (id LONG PRIMARY KEY, red LONG, green LONG, blue LONG, ";
sql += "FOREIGN KEY (id) REFERENCES Palette(id) ON DELETE CASCADE);";

query.exec(sql);

If I remove the "ON DELETE CASCADE" part from the sql statement it works fine and the foreign key and table are created.


How can I check if the ODBC driver supports delete cascades?

If I use the MS Access tool, it works as there is a toggle option to enable the cascade.

I am using Qt 5.9, Windows 10.