SQL Server 2005: When clicking "Add" database I keep getting 'verify that the path or file exists'

Posted by Code Sherpa on Stack Overflow See other posts from Stack Overflow or by Code Sherpa
Published on 2010-06-14T19:03:34Z Indexed on 2010/06/14 23:42 UTC
Read the original article Hit count: 154

Filed under:
|

When I right click on "databases" in Sql Server 2005 Management Studio and then > Attach... > Add I get the following error:

C:\Documents and Settings\Administrator\My Documents\SQL Server Management Studio\ Projects\Path\To\MDF\And\LDF\Files\ cannot access the specified path or file on the server. Verify that you have the necessary security privileges and that the path or file exists.

The answer is easy - the MDF and LDF files where removed when Nant (by way of my dev machine) issued a drop command.

But, after replacing the MDF and LDF files, I want to reattach the database but the above error keeps coming up when I select "Add".

Also, I have already "unattached" the database in question and it no longer appears on the left under "databases".

I have tried to replace a copy of the MDF and LDF files in the folder being referenced and that didn't work.

Any ideas as to how to gracefully get rid of this error?

© Stack Overflow or respective owner

Related posts about sql

Related posts about sql-server-2005