Delphi Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreDelphi Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 17th, 2012, 06:38 AM
dlumley dlumley is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 86 dlumley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 29 m 26 sec
Reputation Power: 12
Please help.. Read only error on client machine install?

Hi, has anyone had this? My app when installed on a clients machine won't write to it's sqlite database.

I get the following error:

Error executing SQL statement.
Error [8]: Attempt to write a readonly database.
"Update collections set col_name = "Default-You can rename this",coltype_id = "3224" where col_id = "1"": attempt to write a readonly database.


I've checked the database properties in explorer and it is not "read" only so I really am not sure what to do?

The install file was created in InnoScript and it works perfectly when tested on my machine but not when I test it on another laptop.

The SQLite3.dll file is included in the install script by the way...

Thanks,

Greg.

Reply With Quote
  #2  
Old July 17th, 2012, 07:46 AM
dlumley dlumley is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 86 dlumley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 29 m 26 sec
Reputation Power: 12
It's a permissions error but how to fix it...

I found the problem but don't know how to get around it...

The database file is installed with Read & Execute & Read permissions under Users.

Try as I may I can't get the Inno setup to install with "full control" even though I'm setting the permissions in InnoSetup to do this...

Its as though Win7 simply overrides this setting....

I'm testing on a Vanilla laptop with Win7 installed...

Any ideas?

Reply With Quote
  #3  
Old July 17th, 2012, 08:11 AM
majlumbo majlumbo is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2008
Posts: 253 majlumbo User rank is Lance Corporal (50 - 100 Reputation Level)majlumbo User rank is Lance Corporal (50 - 100 Reputation Level)majlumbo User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 2 Days 23 h 37 m 14 sec
Reputation Power: 5
Which directory is SQLite working from? Win7 UAC will block attempts to write to certain directories on your hard drive.

Older versions of Delphi made a sub-directory of Program Files the location of your development directory, and many programmers put all there utility files (files they read and write to in the operation of their program) in the same directory. With Vista and above, the program directory is no longer a valid place to put files that need to be written to.

You can get around this by changing the location that SQLite works in. I haven't worked with the database before, but I'm sure there has to be a preferred location for the database to operate from.

Reply With Quote
  #4  
Old July 17th, 2012, 09:20 AM
dlumley dlumley is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2002
Posts: 86 dlumley User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 h 29 m 26 sec
Reputation Power: 12
Yup! The database was working from the Program Directory... I'm busy moving it to the %appdirectory% and I think all will be solved :P

G

Quote:
Originally Posted by majlumbo
Which directory is SQLite working from? Win7 UAC will block attempts to write to certain directories on your hard drive.

Older versions of Delphi made a sub-directory of Program Files the location of your development directory, and many programmers put all there utility files (files they read and write to in the operation of their program) in the same directory. With Vista and above, the program directory is no longer a valid place to put files that need to be written to.

You can get around this by changing the location that SQLite works in. I haven't worked with the database before, but I'm sure there has to be a preferred location for the database to operate from.

Reply With Quote
  #5  
Old July 18th, 2012, 04:32 AM
Luthfi Luthfi is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2012
Posts: 140 Luthfi User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 4 h 53 m 11 sec
Reputation Power: 2
Looks like your problem is caused by UAC protecting the folder where you stored the sqlite database file. You should consider putting it in user's application data or "all users" application data, to make it writeable by the current user.

I wrote a tutorial addressing the use of the special folders to avoid exactly your problem while still harnessing UAC protection power. Read it here: http://forum.codecall.net/topic/60120-using-special-folders-to-comply-with-uac-enabled-windows-with-delphi-code/

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreDelphi Programming > Please help.. Read only error on client machine install?

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap