Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Sqlite DB readonly
Sqlite DB readonly [message #39285] Fri, 08 March 2013 16:20 Go to next message
forlano is currently offline  forlano
Messages: 1114
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

a user of mine (using Windows 7) reported a strange problem.
His (my) program create a sqlite db but after some operation the db become read only type and no modifications were possible.

I tried to open and modify the data with the tool sqliteadmin but the data cannot be changed (it is read only as said).

It looks very strange. Does anybody met such case? What can be happened to turn a writable db in readonly mode?

Thanks,
Luigi

edit: the operative system was Vista

[Updated on: Fri, 08 March 2013 19:23]

Report message to a moderator

Re: Sqlite DB readonly [message #39286 is a reply to message #39285] Sat, 09 March 2013 11:25 Go to previous messageGo to next message
deep is currently offline  deep
Messages: 227
Registered: July 2011
Location: Bangalore
Experienced Member
Hi Luigi,


In windows 7 some folders will be set readonly like "Prgram files" " Program Files (x86)" etc.

from
http://sqlite.phxsoftware.com/forums/p/1163/10790.aspx
Quote:


It's sounds like you're just getting aquainted with Windows 7 security defaults. Generally speaking (and I do mean "generally"), MS now wants you to put your data bases/files in directories like "Documents" or "AppData" going forward AND to "help" us with this, they've changed the directory defaluts among other things. If you can, relocate your DB's. And naturally, there's a down side. AppData, which can be referenced directly via C: etc. has some odd characteristics...like it's invisible and you have to set bits to see it. Documents is pretty good but it can be relative to the domain environment. We ship computers/evironments with our product so have the luxury of being able to force our customers into particular directory structures.

If you really want to install your app including db in the Program files or PF x86 directory, you'll have to change the directory security to read/write as the default is now (with Win 7) read only. This is a lot trickier than it sounds and quite frankly we only did this manually a couple times and after agonizing our way through it, we decided that we'd do what MS wanted us to. (To give you a heads up, you'll change directory security in Windw Explorer and it will lie to you and tell you that you've changed it. BUT if you run your app or return to Windows Explorer, you'll see it didn't chage the setting. Next time my users piss me off, I'm writing something like this myself.) Sqlite is apparently (from our experience and deduction, not looking at the source code), seems to be subject to the directory settings in which it is located...which of course makes complete sense. You can google how to change the security for the directory but it's tricky. AND our experience is that if you add a new user to your machine, the directory security gets reset.




from
http://forums.realsoftware.com/viewtopic.php?f=3&t=38687
Look at last reply and link within
Quote:


What are the permissions on the Program Data folder? Should be read only on Windows 7 all files in that folder will be made read only because of that, and you shouldn't change that setting.

On Win7
SharedApplicationData is Program Data folder which is a hidden folder and all the files in it are read only

You can change the ACL using DirectorySecurity but I'd suggest doing it in a subfolder, not Program Data.


http://blogs.msdn.com/b/amitava/archive ... se-15.aspx



Warm Regards

Deepak

[Updated on: Sat, 09 March 2013 11:31]

Report message to a moderator

Re: Sqlite DB readonly [message #39288 is a reply to message #39286] Sat, 09 March 2013 14:10 Go to previous message
forlano is currently offline  forlano
Messages: 1114
Registered: March 2006
Location: Italy
Senior Contributor
Hi deep and thanks for the answer. It is a very weird stuff.
If this are the danger perhaps the db should be create in some other way without to use the default.

Regards,
Luigi

Previous Topic: SqlArray with Ctrls (in place)
Next Topic: Select from two temporary tables
Goto Forum:
  


Current Time: Mon Jan 25 20:15:47 CET 2021

Total time taken to generate the page: 0.00906 seconds