One of the common Errors while attaching a .mdf file for restoring Data is as follows:
An error occurred when attaching the database(s). Click the hyperlink in the Message column for details.
The detailed message is as follows.
Right, Click on the .mdf that you want to attach and click on Properties.
Go to Security tab and give Full Control to all Users and Groups by clicking on Edit.
Click on the Check Box under Allow section for Giving Full Control to all Users and Groups.
Right-click on the Main Folder containing your .mdf file and go to the properties section.
Deselect the “Read Only Option” in “General Tab” and click on Apply.
Go to the “Security Tab” and give “Full Control” to all “Groups and User Names” as shown in Step 2 and click on Apply.
Select “Apply changes to this folder, subfolder and files” option and click on “Ok”.
Click on “Ok” to apply all the changes.
Now go to SQL and Attach your .mdf file Again and your DB will be attached to the Databases folder and you can access it.
Check out my other blog here https://www.cloudfronts.com/performing-update-operation-in-microsoft-dynamics-nav-through-integration-in-scribe-online/