I was able to execute the SQL using the exec() method of QSqlDatabase. QSqlQuery reported the error. I can't say why QSqlQuery would not execute the SQL. In other code, I'm still using the returned QSqlQuery from QSqlDatabase::exec().
The code is here:
QString path = fileInfo.absoluteFilePath().replace("/", "\\");
msgBox.setText("Unable to open database!");
QString sql =
"CREATE TABLE USER_CONTACTS(ID INTEGER PRIMARY KEY AUTOINCREMENT, "
"CONTACT_ID INTEGER, URI VARCHAR(32))";
contactDatabase.exec(sql); // This works without an error
Thanks for your comments, they were very helpful.
Re: Sqlite3 and Out of Memory error
I'm sorry, but every time you post code it looks different, and you still leave out much of the declaration and initialization. (And please click on the "#" symbol when posting so that you can quote your code in a formatted block.)