问题
I am experiencing an SQLite error when attempting to step on an sqlite3_stmt
. Surprisingly, I got the error 14: unable to open database file.
This is confusing as I opened the database earlier, and successfully submitted an insert into one of the tables. At no point did I close the database.
BEGIN TRANSACTION
INSERT to table A
INSERT to table B
END TRANSACTION
When I attempt to run the second insert command, I get the failure.
Does anyone have any idea of what might cause this issue?
回答1:
It's likely SQLite is unable create/write to a required temporary file for the transaction. Check your temp location.
See sqlite3_temp_directory.
回答2:
This solution worked for me. chowning the dir to the user opening the db https://www.pantz.org/software/sqlite/unabletoopendbsqliteerror.html
来源:https://stackoverflow.com/questions/21343380/why-am-i-getting-an-sqlite3-error-14-unable-to-open-database-when-calling-step