$dir = 'sqlite:C:/Program Files/x/'.$DataBaseName.'.sqlite'; $database = new PDO($dir) or die("cannot open the database"); //Database is always created sucessfully here
function1() { bool delete = false; delete = HandleDataBase(name); if(delete) remove(filename);//C++ error 32, file is under use. } HandleDataBase(name) { sqlite3 *database; if(sqlite3_open(name, &database) == SQLITE_OK)//database exists { const char *pSQL[6]; pSQL[0] = "select * from Table1"; sqlite3_stmt *statement1; if ( sqlite3_prepare(database, pSQL[0], -1, &statement1, 0 ) == SQLITE_OK )//i believe this makes the database busy, but how to meake it nonbusy after performing operations { } int rc = sqlite3_close(database);//failing since the database is busy if ( rc == SQLITE_BUSY) { bool busy = true;//true, the database here is always busy. } return true;//delete the database if it exists. } return false; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)