Hi,
I recently formatted my HDD and installed Windows 7. Then I re-installed SQL Server 2008 Express. Then I went to attach a database which I had detatched before formatting my HDD. I now get an error:
Unable to open the physical file "<file location>". Operating system error 5: "5(failed to retrieve text for this error. Reason: 15105)". (Microsoft SQL Server, Error: 5120)
After I got the error I tried:
Running the SQL Server service with the NETWORK SERVICE, LOCAL SERVICE and my own personal log ons, all of which I made sure had full control privileges of the file.
Logging on to SQL Server Management Studio with the SA account before attempting the attach, which definitely uses the SYSADMIN role.
None of these worked.
Ideas?
Thanks in advance!
Apart from that, a few helpful pointers here:
http://social.msdn.microsoft.com/forums/en-US/sqltools/thread/ad2b2e0d-aecb-4f95-89a8-04dd27ac4944/
I usually avoid detach and attach and prefer to create a new DB and restore from backup. That's personal preference and some people would say otherwise.