Wednesday, April 09, 2008

SQL SERVER EXPRESS 2005 The operating system returned the error '5(Access is denied.)'

System.Data.SqlClient.SqlError: The operating system returned the error '5(Access is denied.)' while attempting 'RestoreContainer::ValidateTargetForCreation' on 'c:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\TEST.MDF'. (Microsoft.SqlServer.Express.Smo)

1)give a different location to save the mdf and ldf file!
2)C:\Program Files\Microsoft SQL Server\MSSQL.1

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data



For my SQL User Accounts on my machine to allow them to write the MDF and LDF Files to those locations.

3)My solution goto configuration tool-sql server configuration manager-sqlserver2005services-properties

change network sevices to local system

HTH someone

2 comments:

Unknown said...

Thank you....

Name Company said...

no problem dattatraya...im glad help you

Locations of visitors to this page
DROP ME A MSG :D