You don’t have permission to open this file.


  • I’m on a new laptop that I purchased last week and just finished configuring today. I created a new SQL Server database (a very simple one). Now, I’m trying to connect to this DB and I’m getting this message:


    You don’t have permission to open this file.

    Contact the file owner or administrator to obtain permission.

    Well, it just so happens that I’m the administrator and there is NO SECURITY of any kind on this DB. What could be preventing me from accessing this BD? Thanks, Ryan--

    Wednesday, March 31, 2010 2:11 AM


  • You can not just double click on the database and open it. You will need to attach it to the database by using the command line tools, or the management studio. If you are the admin of the OS, you can right click on the file and change the permissions as well as take ownership of the files. But I think your problem is that the file has not been added to the server.

    Note that you can also use a user instance of the database with the file by changeing the connection string to attach the file on connection, but in this case your application will be the only thing that can connect to the file as it will be in a single user mode. - XNA Game Programming News and Resources from Downunder.
    • Marked as answer by ryguy72 Wednesday, March 31, 2010 8:04 PM
    Wednesday, March 31, 2010 2:48 AM