设置 Visual Studio 数据配置向导的 SQL 数据库权限

发布于 2024-09-04 08:38:34 字数 224 浏览 2 评论 0原文

我是 SQL 新手。我已经在 SQL Server Management Studio 中创建了一个新数据库,现在尝试通过内置的数据配置向导将其附加到 Visual Studio 中的 Windows 窗体项目。

目前,每当我尝试附加数据库文件时,都会收到权限错误:

“您无权打开此文件。请联系文件所有者或管理员以获取权限”

所以,简单的问题 - 如何修改权限我的数据库允许这样做吗?

I'm new to SQL. I have created a new database in SQL Server Management Studio, and am now trying to attach it to a windows forms project in Visual Studio via the built in Data Configuration Wizard.

Currently, whenever I try to attach the database file, I get a permissions error:

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

So, simple question -- how do I modify the permissions of my database to allow this?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

甜是你 2024-09-11 08:38:34

“以管理员身份”运行 Visual Studio 似乎已经解决了这个问题。

Running Visual Studio "as Administrator" appears to have solved this.

浊酒尽余欢 2024-09-11 08:38:34

如果您使用的是 SQL 2008,您很可能需要将 Windows 用户帐户设置为 SQL 管理员。这可以在安装时完成,也可以使用 SQL Server 安装中心完成。当您在计算机上安装 SQL Server 时,这很可能是错误的。您以管理员身份运行它向我展示了这一点,因为我不需要在具有正确配置的 SQL 2008 服务器的 Vista 或 W7 计算机上执行此操作。

If you are using SQL 2008 most likely you need to set your windows user account as an adminstrator for SQL. This is done either when installing it or maybe using the SQL Server Installation Center. This was most likely done incorrectly when you installed SQL server on your machine. You running it as adminstrator is showing to me this exactly as I have no need to do so on either my Vista or W7 machines with a properly configured SQL 2008 server.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文