Make SQLite connection fail if database is missing? (deleted/moved)

前端 未结 6 592
终归单人心
终归单人心 2021-01-18 11:39

I have the following method inside class DBConnection. I call the method like this: SQLiteConnection conn = DBConnection.OpenDB(); when I want to o

6条回答
  •  日久生厌
    2021-01-18 12:36

    If you want to detect database corruption issues on start up , you can execute the command

    pragma integrity_check;

    or

    pragma quick_check; ( which is faster, but less thorough )

    This returns a single row with the value "ok".

    Otherwise it will report errors that it encounters.

提交回复
热议问题