When I tried attaching a mdf file using SQL SERVER 2008 R2 I got the following error:
"Attach Database failed for Server "XXXXXX"
Database cannot be opened because it is version 706. This server supports version 661 and earlier
Solution
This is because the database I was trying to attach is SQL Server 2012. The only way to resolve this is to Generate Script from SQL Server 2012 then run it in SQL Server 2008 R2. This needs to be done for data too.