CristiMatei Member Licensed User Longtime User Feb 20, 2014 #1 Hi. Does anybody know why is this happening? I have a sqlite db for browsing and everything works ok when I'm compiling with the option "Debug". If I'm changing to "Release" I get "android.database.sqlite.SQLiteException: not an error (code 0): Could not open the database in read/write mode." message when I'm trying to connect to database. Thank You
Hi. Does anybody know why is this happening? I have a sqlite db for browsing and everything works ok when I'm compiling with the option "Debug". If I'm changing to "Release" I get "android.database.sqlite.SQLiteException: not an error (code 0): Could not open the database in read/write mode." message when I'm trying to connect to database. Thank You
LucaMs Expert Licensed User Longtime User Feb 20, 2014 #2 Probabily your DB is in the DirAssets folder; the files in this folder are read-only. You should move the DB to the File.DirDefaultExternal folder Upvote 0
Probabily your DB is in the DirAssets folder; the files in this folder are read-only. You should move the DB to the File.DirDefaultExternal folder
eps Expert Licensed User Longtime User Feb 20, 2014 #4 Yep, you need to be doing something like this : Code: Copy 'Database hasn't been copied to read/write area If FirstTime = True Then If File.Exists(File.DirInternal,"thedatabase.db") = False Then File.Copy(File.DirAssets,"thedatabase.db",File.DirInternal,"thedatabase.db") End If End If Upvote 0
Yep, you need to be doing something like this : Code: Copy 'Database hasn't been copied to read/write area If FirstTime = True Then If File.Exists(File.DirInternal,"thedatabase.db") = False Then File.Copy(File.DirAssets,"thedatabase.db",File.DirInternal,"thedatabase.db") End If End If
johnB Active Member Licensed User Longtime User Mar 30, 2015 #5 Interesting, I had the same problem , one app has worked without a problem since day 1, now I've copied the basics into another app, using the same SQlite db and got this read/write error on Release. Just by referring to File.DirDefaultExternal with Dim a As String = File.DirDefaultExternal in the Sub Activity_Create(FirstTime As Boolean) fixed the problem??????????? My DB is not in that Folder either Upvote 0
Interesting, I had the same problem , one app has worked without a problem since day 1, now I've copied the basics into another app, using the same SQlite db and got this read/write error on Release. Just by referring to File.DirDefaultExternal with Dim a As String = File.DirDefaultExternal in the Sub Activity_Create(FirstTime As Boolean) fixed the problem??????????? My DB is not in that Folder either
johnB Active Member Licensed User Longtime User Aug 18, 2015 #6 Had the same problem again and the above worked again??????? Upvote 0