I'm trying to make my app work happily under Windows 7 (and 8) UAC. Currently, the app uses SQL Server 2005 Express as the backend DB. I have built a feature for backing up the database. This is nothing fancy, but just implementing this process: detaching the DB files (.mdf and .ldf), make a copy of the files, add the copies to a ZIP archive, then re-attach the original files.
Initially, before the DB files are attached to the SQL Server instance, in source code, I had made sure that the files have "Everyone - Full Control" in their ACLs. But once they are attached, SQL Server process takes over, and removes "Everyone - Full Control". Once the files are detached, "Everyone - Full Control" is not added back into their ACLs.
Does anyone know why this happens? And how and I stop it from happening? The problem arises when after detaching the DB files, I have to add them to a ZIP archive. Running as a standard user on Windows 7, with UAC enabled, UAC will not allow me to add these files to a ZIP archive, nor copy them to a different folder. Also, I cannot manually add "Everyone - Full Control" to their ACLs either. I received this error when attempting to modify their ACLs: “Attempted to perform an unauthorized operation”.
Please help. Thanks.