Accessing a SQL Server database from Visual Studio

2019-07-30 15:19发布

I am using Visual Basic 2010 to write a front end to a database I created in SQL Server 2008. The problem I am having is when trying to add the SQL Server database as a new data source, I get the error message:

You don't have permission to open this file. Contact the file owner or an administrator to obtain permission

So is this a permission I need to set up in SQL Server to allow the connection from VB? If so, can someone please tell me what this is?

Really stuck with this, hoping to find an answer asap if possible.

2条回答
狗以群分
2楼-- · 2019-07-30 16:05

You can try open your Visual Studio as 'Administrator' and if it works, then the issue is with Visual studio.

Else it should be with your SQL Server. Try the below steps;

  • Right click on your database and choose Properties option.
  • In the pop up window, go to Option ad change the auto close option to true as shown below;

enter image description here

查看更多
来,给爷笑一个
3楼-- · 2019-07-30 16:19

check the permission in file for specific user.(Read/Write Access)

查看更多
登录 后发表回答