After using sqlite3_prepare_v2 to prepare "BEGIN TRANSACTION", "END TRANSACTION", and "ROLLBACK TRANSACTION", the system will fault at a delayed time when calling sqlite3_step. If I call prepare and step right away, there is no fault. It runs fine. Thus, if I just execute "BEGIN TRANSACTION", I have no problem. If I prepare a statement and execute it in the same function, there is no problem too. The problem occurs when I store a prepared statement and access it at a later time. In debugging, I checked if anything was changing the sqlite3_stmt* pointer in-between. There was no tampering in the program. In fact, I created a SQLiteStatement class that wrapped the sqlite3_stmt*, initialized it to 0, finalized it when done, and prevented it from being overwritten with operator overloading the '=' sign. I did this to ensure the safety of the prepared sqlite3_stmt*.
Thank you for your help, Ch?