如何将 .mdf 文件附加到 .SQLEXPRESS [英] How to attach .mdf file to .SQLEXPRESS

查看:44
本文介绍了如何将 .mdf 文件附加到 .SQLEXPRESS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试将其作为连接字符串

Tried this in as connection string

connectionString="Server=.\SQLEXPRESS;
    AttachDbFilename=E:\Database\dnn49.mdf;Database=dnn49; 
    Trusted_Connection=Yes;" 

但我收到一个错误

无法打开物理文件E:\Database\dnn49.mdf".操作系统错误 5:5(访问是被拒绝.)".无法附加文件'E:\数据库\dnn49.mdf'作为数据库'dnn49'.

Unable to open the physical file "E:\Database\dnn49.mdf". Operating system error 5: "5(Access is denied.)". Cannot attach the file 'E:\Database\dnn49.mdf' as database 'dnn49'.

是什么?

推荐答案

您必须检查 SQL Server 服务帐户对物理文件dnn49.mdf"具有修改权限,并且还对包含该文件的文件夹具有修改权限.

You must check the SQL Server Service account has modify permissions over the physical file "dnn49.mdf" , and modify permissions also over the folder that contains the file.

这篇关于如何将 .mdf 文件附加到 .SQLEXPRESS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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