I am using SQL Server Express 2017 with Visual Studio Professional 2017. I installed SQL Server in mixed mode.
I have a database that I created in SQL Server, with a few tables. It is located on a network drive so that it is properly backed up, rather than storing on my local hard drive. Perhaps this is a problem?
I am trying to add the database (ResourcePlanning.mdf) to Visual Studio. I am going to Server Explorer and Right-clicking Data Connections / Add Connection... Then selecting Microsoft SQL Server Database File / Continue and selecting the actual file via Browse. I have chosen both Windows Authentication and SQL Server Authentication options.
The error I am continually getting is: You don't have permission to open the file. Contact the owner or an administrator to obtain permission.
The problem is, I am the owner, and everything was created locally on my PC. SQL Server is installed on the same PC as Visual Studio. As I said, I placed the database file on a network path called \\w2012\Users\Steve A\MSSQL\DATA. This path has full permissions, as does the PC. I also have the correct local administration rights on my user account.
I have tried to move this file over to a local C-drive folder, and this too fails, saying I need permission to perform this action, that I require permission from the computers administrator to make changes to this file.
If I right-click the mdf file and select Properties / Security, I am told that I must have read permissions to view the properties of this object.
Strangely, I created the file under the same login as I am trying to connect and potentially relocate with.
Please let me know your thoughts on the matter.