0

I'm having trouble deleting a file using C++ 'remove' in my sqlite project. All I'm trying to do is delete a database file. The problem is it won't delete.

I found the below solution which says that you just call query.close() to release the database file in sqlite but I'm just not sure how to do that? I have never used a query class in sqlite. Does anyone know how to call the query.clear() method?

Here's the link to the solution to the same problem I have - Releasing the Database in sqlite.

The other links to this never solve the issue.. They talk about garbage collection but don't explain how this is done.

Svetsi
  • 305
  • 1
  • 4
  • 12
  • 1
    What is 'remove'? Show code. Your link does not refer to C++. –  Jun 26 '17 at 10:24
  • `close` is a method of the connection, not of the query. – Federico klez Culloca Jun 26 '17 at 10:45
  • Put another way. How do you execute the query.clear() method shown in the above linke? Let's forget about the C++ remove method for now. – Svetsi Jun 26 '17 at 11:05
  • Which kind of Sqlite interface are you using? The C++ interface provides sqlite3_open() and sqlite3_close() methods to open and close db connection. – Simone Cifani Jun 26 '17 at 13:29
  • Possible duplicate of [System.Data.SQLite Close() not releasing database file](https://stackoverflow.com/questions/8511901/system-data-sqlite-close-not-releasing-database-file) – crizzis Jun 26 '17 at 13:51
  • sqlite_close doesn't close the connection.. It just de-allocates it from what I understand. The query has to be deleted as well. This is where I'm getting stuck. If I try to delete the Database file in my program, it won't delete because it is 'Busy'. It is 'Busy' despite calling sqlite_close. I'm using sqlite3. I've also tried using sqlite3_close_v2 with no luck either. – Svetsi Jun 26 '17 at 20:23

0 Answers0