This error happened in SQL Server 2008 when you click New Query after editing a SQL script and are not connected to a server.
Steps to Reproduce:
1. edit a SQL script through Windows Explorer (open with SQL Management Studio)
2. click Cancel in the connect to database engine dialog
3. click New Query
That what usede to happen anyway. Today I cannot get the error to happen, so I am eith er missing a step or the bug was fixed. Now when I click New Query it prompts you to connect to a database.