Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Dec 09, 2019 10:14 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Database set to 'Read Only'
PostPosted: Tue Oct 19, 2010 4:25 pm 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
Someone was testing my application, and at one point they closed the application and relaunched it, and an error dialog came up. The database was somehow set to 'read-only' between launching. I have no code that would be doing that (or, at least, not that I know of) and this has never come up before during anyone else testing. This user is on Windows 7, and the database file is stored in:

SpecialFolder.SharedApplicationData.child(AppFolderName)

(AppFolderName is a valid string constant)

I renamed the database file (got a message that said 'You'll need to provide administrator permission to rename this file.') and the application created a new empty database which worked properly. The new database I could rename without the warning message. I did not get a 'read-only' error after relaunching with the newly created database.

Is there anything that could have changed the 'read-only' property of the database without my/his knowing it? He says he didn't install it under any other account other than the one he always uses. And I believe he relaunched it right after quitting out.

Is there a way I can try to change this property in the application?

BTW, the Database is a single-user RealSQLDatabase.

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: Database set to 'Read Only'
PostPosted: Wed Nov 17, 2010 10:24 am 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
This just happened again to me, and I have had a better chance to look at the resulting database. I was doing some debugging today, and don't know if anything I was doing - i.e. running in debug mode and closing the debug app without making a call to close the database connection - could be responsible, but when it happened the first time, it was an installed application on a user's computer so it should have closed everything properly.

When I view the properties for this database, and an older copy of the database, I see that the current user (the second row in the 1st image) has been completely removed from the list of group/user names for this file.

Original file:
Image
Snarfed file:
Image

The database is created completely in code within the application, so I can't change any settings before or during the install.

I was able to fix the file by changing the permissions for the User's group (last one in the list), but I (and my tech people) are not familiar with Windows 7 enough to know if I can repair the current user settings. Is there a way to fix the file's permissions for the current user, or alternately, to change the User's group permissions. This would have to be done within my RB application.

Is there anything I can do to help prevent this from happening in my application? I will check to be sure that the database connection is closed properly when the application closes, but could this be the cause if it wasn't?

Any assistance would be greatly appreciated.

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
 Post subject: Re: Database set to 'Read Only'
PostPosted: Wed Nov 17, 2010 12:11 pm 
Offline

Joined: Wed May 20, 2009 4:43 pm
Posts: 958
I may have found a shell command to fix the corrupted file; since this is a Windows issue, and not a database issue, I have started a new discussion under the Windows forum.

http://forums.realsoftware.com/viewtopic.php?f=6&t=36350

_________________
RB 2009r4 Windows XP


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group