Well it works using SQLite extensions.
But - to enable the use of extensions I have to call sqlite3_enable_load_extension. This doesn't work. The app always crashes when calling sqlite3_enable_load_extension(handle,1).
Did I make a mistake?

Qt Code:
  1. QSqlDatabase db = QSqlDatabase::database();
  2. QVariant v = db.driver()->handle();
  3. if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*")==0) {
  4. // v.data() returns a pointer to the handle
  5. sqlite3 *handle = *static_cast<sqlite3 **>(v.data());
  6. if (handle != 0) { // check that it is not NULL
  7. sqlite3_enable_load_extension(handle,1);
  8. }
  9. }
To copy to clipboard, switch view to plain text mode