A: 

The problem you could be having is that your prepared statement is invalid after sqlite3_close. You need to create a new prepared statement each time you open the database.

  1. Open the database with sqlite3_open.
  2. Prepare the statement with sqlite3_prepare and friends.
  3. Bind with sqlite3_bind.
  4. Step with sqlite3_step.
  5. Afterwards, ensure you call sqlite3_finalize.
  6. Close the database with sqlite3_close.

You can't just reset the statement, because that statement was prepared for a different database handle.

NB

I'm not too familiar with SQLite.

dreamlax
sorry I forget to say that all my statements are already prepared when I initialize the database, everything is compiled before to faster access. ---------const char *getFichesVisuelsSQL = GET_FICHES_VISUELS_SQL;sqlite3_prepare_v2(database, getFichesVisuelsSQL, -1, getFichesVisuelsStatement = compiledStatement; -------
ludo
I didn't use the sqlite3_ finalize I will try it. Do I have to do that everytime?
ludo
Each time you open the database, you must prepare your statements again, because that prepared statement is specific to the database you opened. Also, you only called `sqlite3_finalize` to balance the `sqlite3_prepare`, similar to `retain` and `release`.
dreamlax
If you close your database with `sqlite3_close`, all prepared statements that were created using that database handle are now invalid.
dreamlax
But all of my functions are working, the statement already prepared and compiled I just have to reuse functions like that.the problem is that in the same controller view I'm calling 2 differents function and the second one call an argument on the first one.
ludo