Hello all,

I have a question concerning activating the foreign key in qt. I create a query just after opening my database (see below). Is this the correct way? How can i check it?

Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv);
  4.  
  5. QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
  6. db.setDatabaseName("d:/database/Client1");
  7. bool ok = db.open();
  8.  
  9. QSqlQuery query;
  10. query.exec("PRAGMA foreign_keys = ON;");
  11.  
  12. Login w;
  13. w.show();
  14. return a.exec();
  15. }
To copy to clipboard, switch view to plain text mode 

Thank you in advance!