1. Just go to the program files and find the folder of the installed program.2. Just right click the .mdf file in the folder and click PROPERTIES.3. In PROPERTIES TAB -> SECURITY -> you'll see Group or Usernames.4. In that select the User to which u want to give Access to the file.5. If for that user the PERMISSION is not set to FULL CONTROL.6. TO CHANGE PERMISSIONS -> CLICK EDIT.7. Now the Group or Username box will open.8. In that Select The User -> Select FULL CONTROL in Permission Box.9. Now follow the steps for the log file too. IF Needed.

Hope this will help you.Regards,Nirav LalanDNS Gold Member"Failure is the path of least persistence"

Please check the permission level, I think you don't have permission to the specified path or database which you are trying to update. First off all run your script with Administrator privileges.--------------------------------------------------------------------------------Give respect to your work, Instead of trying to impress your boss.

If you install SQL server in the "C"/OS Installed drive you may face this issue.Either you can change the SQL server data in the other drive or you can give the permission to access for the MDF file.

Right click the .mdf file and click PROPERTIES.Go to PROPERTIES TAB -> SECURITY Select the User to Access to the DB file.Check PERMISSION is set to FULL CONTROLBy NathanDirection is important than speed