I developed an application that works fine <= Windows 7. It uses a SQLlite database with VB and C #. However, in Windows 8 (there has never been this specific problem on other Windows windows), a problem occurs when trying to write to the database
System.Data.SQLite.SQLiteException: Attempt to write a read-only database
I created a database file on Windows 8, for example:
Try
If (Not File.Exists(System.Environment.CurrentDirectory & "\MY_DB.db")) Then
Dim conn = New SQLite.SQLiteConnection("Version=3;New=True;Compress=False;Read Only=False;Data Source=" & System.Environment.CurrentDirectory & "\MY_DB.db")
conn.Open()
'...DO STUFF
conn.Close()
conn.Dispose()
conn = Nothing
End If
Catch ex As Exception
'Throw ex
Return False
End Try
But that did not work.
So basically I tried:
- Added
Read Only=Falsewhen creating a db file, but it does not work. - The folder in which the database is located must have write permissions, as well as the actual database file. So it didn’t work (on windows 7 it will look like
).
What can I do to record in databse format?