I think this is what you mean. When you use:
model->setRelation(1,rel);
QSqlRelation rel("tablename", "tableid", "name");
model->setRelation(1,rel);
To copy to clipboard, switch view to plain text mode
update through 'model' works, and:
model->setRelation(1,rel);
QSqlRelation rel("viewname", "tableid", "name");
model->setRelation(1,rel);
To copy to clipboard, switch view to plain text mode
it does not, giving:
Unable to execute statement:
"[MySQL][ODBC 5.1 Driver][mysqld-5.1.48-community]Unknown column 'name' in 'where clause'"
Unable to execute statement:
"[MySQL][ODBC 5.1 Driver][mysqld-5.1.48-community]Unknown column 'name' in 'where clause'"
To copy to clipboard, switch view to plain text mode
Including the 'name' column in your view would be the obvious thing to do first.
Bookmarks