我要附加数据库时出现错误 [英] error when i want to attach database

查看:99
本文介绍了我要附加数据库时出现错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

当我要将数据库附加到我的C#项目中时,会给出此错误消息.

when i want to attach database to my c# project i give this error message.

文件c:\ ..... \ test1.mdf的目录查找失败,原因是操作系统错误5(访问被拒绝)

directory lookup for the file c:\.....\test1.mdf failed whid the oprating system error 5 (access is denied)

无法将文件c:\ ..... \ test1.mdf附加为数据库"test1".

can not attach the file c:\.....\test1.mdf as database 'test1'.

如何解决此问题

推荐答案

文件c:\ ..... \ test1.mdf的目录查找失败,原因是操作系统错误5(访问被拒绝)

你好

正如错误消息已经指出的那样,SQL Server服务帐户没有访问数据库文件的权限.将数据库文件移动到SQL Server安装的DATA子文件夹中,这里的服务帐户确实具有足够的权限来执行以下操作: 读取/写入文件.

As the error message already says, the SQL Server service account don't have the permissions to access the database files. Move the database file to the DATA subfolder of your SQL Server installtion, here the service account do have enough permissions to read/write to the files.


这篇关于我要附加数据库时出现错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆