1

Topic: Cannot attach to database

I have been running Recorder 6 on another machine for the last few days but now have to move it back onto my old laptop. I detached NBNData_Data.mdf and ldf and copied them back to where they used to be, but now I can't get SQL Server to attach the database. It looks in the right place for the data file but can't see it, and if I type the full file path in it comes back with:

Unable to open the physical file "C:\R6 database\NBNData_Data.mdf". Operating system error 5: "5(error not found)". (Microsoft SQL Server, Error: 5120)

Both machines are Windows 7 64 bit with SQL Server Express 2005, and the filepath to the database is c:\Recorder 6\SQL Server\NBNData_Data.mdf. I have tried running as administrator, and have checked that SQL Server is running and the registry entries are as they should be. It worked until a few days ago (apart from a problem with the import wizard which I still haven't got anywhere with) and nothing has changed since.

I vaguely remember seeing this error before but can't find anything on the forum. Any suggestions?

Janet

Janet Simkin
British Lichen Society

2

Re: Cannot attach to database

Not something I have come across. Did you specifically run  Management Studio as Admin ? I assume the database will attach on the PC it came from ?

Mike Weideli

3

Re: Cannot attach to database

I did, and it made no difference. The database attaches on the other PC with no problem.

This is the laptop where I was having the spreadsheet import problem a couple of weeks ago, which also doesn't replicate, so I'm wondering whether something has gone wrong with the SQL Server installation. I'll try reinstalling it.

janet

Janet Simkin
British Lichen Society

4

Re: Cannot attach to database

The problem was resolved by moving the SqlServer files to a different folder. No idea why, but it now works!

Janet

Janet Simkin
British Lichen Society