Accessing a SQL Server database from Visual Studio

风格不统一 提交于 2020-01-06 04:19:14

问题


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.


回答1:


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;




回答2:


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



来源:https://stackoverflow.com/questions/25593952/accessing-a-sql-server-database-from-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!