I am have a sqlite database in the iPhone application I am writing. I get an error with following code that I am running in a background thread. In the background thread, I
you must always close the sqlite database after using it ... so add this line sqlite3_close(DB); just after sqlite3_finalize(statement);
Update -
You are returning YES in one of your while loop -
while (sqlite3_step(statement) == SQLITE_ROW)
{
return YES;
break;
}
so here you are nither finalizing nor closing the database.. you need to close if everytime you open it