Attaching database to the SQL server I have the following error


  The database 'Test' cannot be opened because it is version 661. This
  server supports versions 655 and earlier. A downgrade path is not
  supported.


Usually this kind of error occurs when the database was made with SQL Server 2008 R2 and is opened with for example SQL Server 2008 SP2, but the problem is that I'm trying to open it exactly in SQL Server 2008 R2 which supports version 661. So what's the problem?
You are connected to a SQL Server 2008 instance. The error message clearly indicates that. See How to determine the version and edition of SQL Server and its components, the section on SQL Server Database Engine version lists no less than 4 methods:


  
  Method 1: Connect to the server by using Object Explorer in SQL Server Management Studio. After Object Explorer is connected, it will
  show the version information in parentheses, together with the user
  name that is used to connect to the specific instance of SQL Server.
  Method 2: Look at the first few lines of the Errorlog file for that instance.
  Method 3: Connect to the instance of SQL Server, and then run the following query:
  
  Select @@version;
  Method 4: Connect to the instance of SQL Server, and then run the following query:
  
  SELECT SERVERPROPERTY('productversion'),
       SERVERPROPERTY ('productlevel'),
       SERVERPROPERTY ('edition');