I am looking at updating my applications from RealSqlDatabase to SqLiteDatabase,
Do I need to add a “BEGIN TRANSACTION” before every “db.SQLExecute”?
gDB.SQLExecute “create table xx” (…
gDB.SQLExecute ("Drop table if exists …
dim sql as String = "SELECT * FROM xx …
// run the query
dim rs as RecordSet = gDB.SQLSelect(sql)
Not necessarily. SQLiteDatabase does an implicit commit after each DB command. If you want to do multiple SQL commands in a single transaction, then you should precede them with “BEGIN TRANSACTION” and end them with a specific Commit.
As all my Database commands are single commands that have either a “Commit” or “Rollback” at the end, then I do NOT need the “Begin Transaction”?
I guess I will just have to try it to see what happens. And hope I catch the failures and not the users.
If they are single commands, then you don’t need “BEGIN TRANSACTION”. And without “BEGIN TRANSACTION”, you cannot use Commit or Rollback. So it looks like you don’t need any of them.