I've been trying to access the sqlite3 handle and getting into an exception: "Unhandled exception at 0x778f15de in app.exe: 0xC0000005: Access violation."
Any idea? I've been following the following thread and somehow managed to not get the exception, but really not clear as to why (I've also asked on this thread):
http://www.qtcentre.org/threads/3613...095#post238095
And the code that causes the error:
Here's the code:
db.setDatabaseName("blabla.sqlite");
if (!db.open()) {
return -1;
}
v = db.driver()->handle();
sqlite3* sql3_db = *static_cast<sqlite3 **>(v.data());
//<tag_error>
sqlite3_exec(sql3_db, "CREATE TABLE if not exists ABC(foo,bar)", 0, 0, 0);
QSqlDatabase db;
db = QSqlDatabase::addDatabase("QSQLITE", "testsqliteptr");
db.setDatabaseName("blabla.sqlite");
if (!db.open()) {
return -1;
}
v = db.driver()->handle();
sqlite3* sql3_db = *static_cast<sqlite3 **>(v.data());
//<tag_error>
sqlite3_exec(sql3_db, "CREATE TABLE if not exists ABC(foo,bar)", 0, 0, 0);
To copy to clipboard, switch view to plain text mode
Thank you in advance.
Bookmarks