I'm having a little bit of a problem that I thought was related to Security but, turns out can't be as I did almost everything ...
Plenty of information on this on the web but nothing has an answer to fix the issue.
Let me tell my steps:
Img: Security on Database File from IIS 7.5
(source: balexandre.com)
Note that all other files and folders have the same rights as above
The full Error is:
Log: Executing query on SQLite Database
Message ***************************************
Attempt to write a read-only database
attempt to write a readonly database
Stack Trace ***********************************
at System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)
at System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)
at System.Data.SQLite.SQLiteDataReader.NextResult()
at System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)
at System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)
at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()
at soDatabaseManager.CommitPersonsToKitchenDatabase() in c:\Adwiza\Kitchen\App_Code\soDatabaseManager.cs:line 242
P.S. Keep in mind that this has to work with IIS 6 (windows 2003) as well, the IIS 7.5 is only for troubleshooting as we have more control in everything...
The SQLite file is a writeable file on the filesystem.
SQLite (/ˌɛsˌkjuːˌɛlˈaɪt/, /ˈsiːkwəˌlaɪt/) is a database engine written in the C programming language.
First, by default, multiple processes can have the same SQLite database open at the same time, and several read accesses can be satisfied in parallel. In case of writing, a single write to the database locks the database for a short time, nothing, even reading, can access the database file at all.
Make sure that the anonymous web user account (NETWORK SERVICE or maybe something else) under which your web application executes has read/write/create/delete access to the folder where the sqlite database resides.
The other answer give me an idea about the problem, but my solution was a bit differente. The problem was that the user did not have permissions to modify the folder and the .db file. So I give permission to the user Everyone (collective group for Authenticated Users and Guest). The permisions on NETWORK SERVICE (or similars) did not solve in my case.
Note: The IIS
must be restarted, after the change, to load the change made.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With