Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail From: Erland Sommarskog Newsgroups: comp.databases.ms-sqlserver Subject: Re: How do I fix this error Date: Thu, 10 May 2012 23:53:45 +0200 Organization: Erland Sommarskog Lines: 32 Message-ID: References: <4fabfbd0$0$290$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Injection-Info: mx04.eternal-september.org; posting-host="nBFDv6s1VJQDuF1w6hpX2A"; logging-data="27443"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/P8XN5r0xbwOfcOsRnEr5H" User-Agent: Xnews/2006.08.24 Mime-proxy/2.1.c.0 (Win32) Cancel-Lock: sha1:p7IfRoz5NT5d7ADyxXiChPDhsQk= Xref: csiph.com comp.databases.ms-sqlserver:1039 Tony (johansson.andersson@telia.com) writes: > I have tried with Visual Studio 2010 Proffessional and Visual Web > developer express 2010 but I get the following error when I try to run > the web site. I have also sql server 2008 installed. I addending a > cource and when I try to run the web site that we have got as examples I > get this error. > Does anyone know how to correct so I can run the examples ? > > > Here is the error that I get > ******************* > An attempt to attach an auto-named database for file G:\ASP Module > 3\CarsDB.mdf failed. A database with the same name exists, or specified > file cannot be opened, or it is located on UNC share. Reading the error message, there appears to be three possibilities: 1) You already have a database CarsDB. 2) There is no file G:\ASP Module 3\CarsDB.mdf 3) G is a mapped network drive. The AttachDBFilename is a connection-string option that I've never understood the point with. Why not just attach the database once and for all? -- Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se Links for SQL Server Books Online: SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx