database is read-only?

database is read-only?

Old forum URL: forums.lhotka.net/forums/t/3658.aspx


CSLAer posted on Sunday, October 07, 2007

I tried to build and run the PTWpf. I can login, but when I update the record, I get error message: Failed to update database "PTTRACKER.MDF", because the database is read-only. Can someone tell me what I should do?

Thanks

DeanB replied on Sunday, October 07, 2007

Sometimes when you copy databases the file gets marked "read only".  I have seen on a few occasions (especially with Access) where this can even happen on an install.  The fix is simple.

Find the .mdf file.  Right click it and select properties.  Uncheck the "Read-Only" checkbox and click Apply or OK.

Make sure if you are running VS 2005 or 2008 on Vista that you right click the shortcut and select Run as Administrator.  I hate that.

Dean

CSLAer replied on Sunday, October 07, 2007

DeanB:

Sometimes when you copy databases the file gets marked "read only".  I have seen on a few occasions (especially with Access) where this can even happen on an install.  The fix is simple.

Find the .mdf file.  Right click it and select properties.  Uncheck the "Read-Only" checkbox and click Apply or OK.

Make sure if you are running VS 2005 or 2008 on Vista that you right click the shortcut and select Run as Administrator.  I hate that.

Dean

Thanks for your information.

My databases the files are not marked "read only".  It is running on XP with VS 2008.

DeanB replied on Monday, October 08, 2007

Also you may check the properties for the file and see what users can modify it.  I have had issues with projects on my desktop (in a folder) not allowing certain functions.  Just right click the file, select properties, select security.  I would add everyone with read, modify, and write.  That will tell you that you are in the write ballpark if it works.  Not the most secure way, but it will illuminate your problem if that is what it is.

Copyright (c) Marimer LLC