---
title: "解决Microsoft SQL Server Management Studio Express不能在win7附加数据库的方法"
author: "cetusz"
date: "2010-08-12T15:27:00Z"
tags: []
slug: "microsoft-sql-server-management-studio-express-win7"
draft: false
lastmod: "2010-08-12T15:27:00Z"
id: 787115
url: "https://cetus.iteye.com/blog/787115"
---

今天在win7下用Microsoft SQL Server Management Studio Express附加数据库出现以下错误：

Microsoft SQL Server Management Studio Express  
\------------------------------

附加数据库 对于 服务器“xxxx-pc\\SQLEXPRESS”失败。  (Microsoft.SqlServer.Express.Smo)

有关帮助信息，请单击: [http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID](http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID)=附加数据库+Server&LinkId=20476

\------------------------------  
其他信息:

执行 Transact-SQL 语句或批处理时发生了异常。 (Microsoft.SqlServer.Express.ConnectionInfo)

\------------------------------

无法打开物理文件 "C:\\数据库\\Teacher\_Data.MDF"。操作系统错误 5:"5(拒绝访问。)"。 (Microsoft SQL Server，错误: 5120)

有关帮助信息，请单击: [http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=09.00.4053&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476](http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=09.00.4053&EvtSrc=MSSQLServer&EvtID=5120&LinkId=20476)

\------------------------------

不能附加方案解决。很简单，关闭Microsoft SQL Server Management Studio Express  
然后以管理员身份运行Microsoft SQL Server Management Studio Express.

 

 然后重复刚才的操作就行了。