views:

25

answers:

1

Hi,

For a NUnit test I need to reference a .mdf file from a .config file. Unfortunately, I get the following error message:

The FOR ATTACH option requires that at least the primary file be specified.

An attempt to attach an auto-named database for file
C:\....\*.mdf
A database with the same name exists, or specified file cannot be opened, or it is located on UNC share. 

I looked for this error on google but didn't find anything that helped me solve my problem.

Any idea?

Thank you

Edit Apparently the .log file is missing.

A: 

Yeah, as snippy as it sounds:

  • A database with the same name may already exist (database name possibly != file name).

  • The specified file may not be something SQL Server has access to

Is the file unique and not bound to the server at the same time (like from another unit test)? Does the SQL Server service account have access to the file?

TomTom
1/ Yes the file is unique, in fact I created it manually and even when I give it a name different from the server one I get the same error message.2/ Yes SQL Server has access to the file.
Amokrane
Supposedly not - .log missing is incomplete database ;) Per your edit. File(s) thus do not exist ;)
TomTom