The error message
Msg 1959, Level 16, State 1, Line 2
Cannot create an index on a view or computed column because the compatibility level of this database is less than 80. Use sp_dbcmptlevel to raise the compatibility level of the database.
is run time error level of severity level 16. It can occur on all versions of SQL Server onwards to SQL Server 2000. This error message appears when you try to create an indexed view that is contained in a database with a compatibility level less than 80. Compatibility level 80 belongs to SQL Server 2000 database. As errors of severity level 16 are generated and can be corrected by user. To index a view the compatibility level of the database must be at least 80 (or higher), so you have to increase the compatibility level of that specific database.
It is relevant to mention here that on a higher version of SQL Server you may have a database with compatibility level to a previous version.