I am trying to delete a SQLite database(file) through C++, which is created using php file. I am getting the SQLITE_BUSY error and was not able to solve it.
Creating the database in PHP:
$dir = 'sqlite:C:/Program Files/x/'.$DataBaseName.'.sqlite';
$database = new PDO($dir) or die("cannot open the database");
Accessing and Deleting the database in C++:
bool delete = false;
delete = HandleDataBase(name);
if(sqlite3_open(name, &database) == SQLITE_OK)
const char *pSQL;
pSQL = "select * from Table1";
if ( sqlite3_prepare(database, pSQL, -1, &statement1, 0 ) == SQLITE_OK )
int rc = sqlite3_close(database);
if ( rc == SQLITE_BUSY)
bool busy = true;
How do i solve my issue, how should i close the database after reading and updating information(using sqlite3_prepare) so that i can delete it?