Error while trying to attach .mdf to a SQL Server Express 2008
The snapshot says is it all - I used to be able to attach a dat开发者_运维百科abase, but after i detached today then tried to attach, i kept getting this error:
http://img197.imageshack.us/img197/2574/attacht.jpg http://img197.imageshack.us/img197/2574/attacht.jpg
http://img197.imageshack.us/img197/2574/attacht.jpg
Error 5 means Access Denied. The account running SQL Server has no access to the file GMATech.mdf. Grant the necessary rights:
cacls "c:\Program...\GMATech.mdf" /E /G SQLServerMSSQLUser$<hostname>$<instancename>:F
where hostname is the name of the mahcine running SQL and instancename is the name of the SQL instance (MSSQLSERVER for default instance).
精彩评论