When I try to attach mdf file I got following error below.
There are multiple solutions to this
1 1. Move .mdf and .ldf to SQLServer install directory Data folder (eg C:Program Files (x86)Microsoft SQL ServerMSSQL10.SQLEXPRESSMSSQLDATA) and then attach.
2 2. Give SQL SERVER SERVICE account full access to folder where mdf and ldf files are located.
3 3. Run as Administrator as in Below screens.
Run SSMS as admin as shown in screen below