Let me start off with the code I am using to delete the records from my tables:
dData("Player_Data", bErrors); That calls the function, pass the table name and a bool to tell if there was an error. The function:
void Database::dData(string table, bool* bErrors) { sqlStr2 = "Delete From " + table; sqlite3_exec(dBase,"BEGIN TRANSACTION",NULL,NULL,&error); if (sqlite3_prepare_v2(dBase, sqlStr2.c_str(), sqlStr2.size(), &statement2, 0) == SQLITE_OK) { sqlite3_step(statement2); *bErrors = false; finalize(statement2, bErrors); } else { *bErrors = true; createBInfo(); d.createBReport("SQL Code 3",sqlite3_errmsg(dBase),bLocale + to_string(__LINE__),bTDate,"./SC_Log.txt"); } sqlite3_exec(dBase,"END TRANSACTION",NULL,NULL,&error); } I originally had the delete query as "Delete From" + table. This was failing to delete the record so I changed it to Delete * From based on a suggested answer from a similar question here on SO.
No matter what I try I cannot delete the single record in my Player_Data table. There are no errors generated from the delete query for Player_Data either The code in the tags at the top was causing a syntax error to be logged; returning to the proper syntax did not change the situation.
Does SQLite stop you from deleting the last record in a table from the c/c++ interfaces?