Why am I getting an sqlite3 error 14 (unable to open database) when calling step on an sqlite3_stmt?

别说谁变了你拦得住时间么 提交于 2021-02-11 18:01:49

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!