I am using Visual C++ to write a small app which will invoke SQLite C Interface to create an database and insert some data into it.
When debugging the application, I want to check the data in the database. Therefore, I start the sqlite3 shell(sqlite3.exe) from commandline, then use the following command to open the database:
.open filename
Thereafter, I want to check the table created by my app, but always get “table does not exist” error.
Then I use “select * from sqlite_master;” but still return empty result.
I make more tests as below:
- Try to open the database again with --readonly option, as below:
.open --readonly FileName;
- After opening the database, I try to use command like this:
select * from sqlite_master;
Then I will see "database is locked" error. I try to search on Stackoverflow for solutions, and all solutions just suggest to close the other application that is accessing the database. However, what I need is just let the app still access the database, meanwhile I can still view(not modify) the contents in the sqlite database, is that possible?
Therefore, I just wonder whether I can access a sqlite database which has already been opened by another program simultaneously via the sqlite3.exe shell? Currently only my app will write into the database, and sqlite3 shell only needs to read the data in the database.