By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,414 Members | 1,024 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,414 IT Pros & Developers. It's quick & easy.

IIS7 on Vista and SQLExpress problem

P: n/a
Hi,

I wonder if someone could shed some light on this one for me.

I have developed a web app in VS2005 with the built in server. It uses an
sql database, everytihng works.

I need to test it across the network, so i've installed IIS7 on my Vista
machine and created a new website, point at the website's directory. After I
switched to the 'Classic .net' app pool, it shows up on the port.

However, the SQLExpress database is giving me an error...

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

The file in question exists, and the whole website directory has Everyone
Full Control permissions, with permission inheritance on, so that should be
fine.

The Visual Studio isntance of this isnt running (im not running visual
studio, the development server, or anything).

My web.config specifies the |DataDirectory|, and my file is in App_Data - in
fact, the database works fine when I run it through VS/Dev Server for
debugging, but it fails on IIS7.

What's going on?!! (and yes, my connection string does specify User
Instance=True.

Any help much appreciated.

Thanks

Dan
Sep 6 '07 #1
Share this Question
Share on Google+
5 Replies


P: n/a
I believe this is because the auto-attach feature of SQLEXPRESS only works
for local connections. You will probably need to permanently attach the MDF
database file using the SQLExpress Manager or the appropriate T-SQL Command.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"musosdev" wrote:
Hi,

I wonder if someone could shed some light on this one for me.

I have developed a web app in VS2005 with the built in server. It uses an
sql database, everytihng works.

I need to test it across the network, so i've installed IIS7 on my Vista
machine and created a new website, point at the website's directory. After I
switched to the 'Classic .net' app pool, it shows up on the port.

However, the SQLExpress database is giving me an error...

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

The file in question exists, and the whole website directory has Everyone
Full Control permissions, with permission inheritance on, so that should be
fine.

The Visual Studio isntance of this isnt running (im not running visual
studio, the development server, or anything).

My web.config specifies the |DataDirectory|, and my file is in App_Data - in
fact, the database works fine when I run it through VS/Dev Server for
debugging, but it fails on IIS7.

What's going on?!! (and yes, my connection string does specify User
Instance=True.

Any help much appreciated.

Thanks

Dan
Sep 6 '07 #2

P: n/a
Thanks for Peter's input.

Hi Dan,

My understanding is after you create new website virtual dir on the Vista
IIS7 box, it still point to the web application directory on original
development machine, through a UNC share. Is this your case?

If so, the error may be caused by the SQL Express database file is on
remote location. I suggest you perform the following test:

** copy the entire website to a local physical directory on the vista box
and configure IIS to use the local locaiton to test

** Or as Peter suggested, you can consider directly attach the database
file to the SQL Express instance on VISTA and let your asp.net application
(modify connectionstring) connect that attached database to see whether it
works.

If there is any other finding, please feel free to post here also.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
<pb*******@yahoo.yohohhoandabottleofrum.com>
>References: <73**********************************@microsoft.co m>
Subject: RE: IIS7 on Vista and SQLExpress problem
Date: Thu, 6 Sep 2007 11:44:02 -0700

I believe this is because the auto-attach feature of SQLEXPRESS only works
for local connections. You will probably need to permanently attach the
MDF
>database file using the SQLExpress Manager or the appropriate T-SQL
Command.
>Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"musosdev" wrote:
>Hi,

I wonder if someone could shed some light on this one for me.

I have developed a web app in VS2005 with the built in server. It uses
an
>sql database, everytihng works.

I need to test it across the network, so i've installed IIS7 on my Vista
machine and created a new website, point at the website's directory.
After I
>switched to the 'Classic .net' app pool, it shows up on the port.

However, the SQLExpress database is giving me an error...

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

The file in question exists, and the whole website directory has
Everyone
>Full Control permissions, with permission inheritance on, so that should
be
>fine.

The Visual Studio isntance of this isnt running (im not running visual
studio, the development server, or anything).

My web.config specifies the |DataDirectory|, and my file is in App_Data
- in
>fact, the database works fine when I run it through VS/Dev Server for
debugging, but it fails on IIS7.

What's going on?!! (and yes, my connection string does specify User
Instance=True.

Any help much appreciated.

Thanks

Dan
Sep 7 '07 #3

P: n/a
Hi Steven,

Unfortunately, there is no UNC share involved - that's why I don't
understand it too well. VS, the website, the mdf, IIS7, firefox... all on the
C: drive of my laptop (Vista Ultimate).

Peter's suggestion sounds like it would break the SQL database in Visual
Studio? I still want to be able to run the site from VS as well for debugging
purposes.

Is it possible to make all this work, all I wanted to do was test my site in
IE6 :(
"Steven Cheng[MSFT]" wrote:
Thanks for Peter's input.

Hi Dan,

My understanding is after you create new website virtual dir on the Vista
IIS7 box, it still point to the web application directory on original
development machine, through a UNC share. Is this your case?

If so, the error may be caused by the SQL Express database file is on
remote location. I suggest you perform the following test:

** copy the entire website to a local physical directory on the vista box
and configure IIS to use the local locaiton to test

** Or as Peter suggested, you can consider directly attach the database
file to the SQL Express instance on VISTA and let your asp.net application
(modify connectionstring) connect that attached database to see whether it
works.

If there is any other finding, please feel free to post here also.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
<pb*******@yahoo.yohohhoandabottleofrum.com>
References: <73**********************************@microsoft.co m>
Subject: RE: IIS7 on Vista and SQLExpress problem
Date: Thu, 6 Sep 2007 11:44:02 -0700

I believe this is because the auto-attach feature of SQLEXPRESS only works
for local connections. You will probably need to permanently attach the
MDF
database file using the SQLExpress Manager or the appropriate T-SQL
Command.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"musosdev" wrote:
Hi,

I wonder if someone could shed some light on this one for me.

I have developed a web app in VS2005 with the built in server. It uses
an
sql database, everytihng works.

I need to test it across the network, so i've installed IIS7 on my Vista
machine and created a new website, point at the website's directory.
After I
switched to the 'Classic .net' app pool, it shows up on the port.

However, the SQLExpress database is giving me an error...

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

The file in question exists, and the whole website directory has
Everyone
Full Control permissions, with permission inheritance on, so that should
be
fine.

The Visual Studio isntance of this isnt running (im not running visual
studio, the development server, or anything).

My web.config specifies the |DataDirectory|, and my file is in App_Data
- in
fact, the database works fine when I run it through VS/Dev Server for
debugging, but it fails on IIS7.

What's going on?!! (and yes, my connection string does specify User
Instance=True.

Any help much appreciated.

Thanks

Dan

Sep 7 '07 #4

P: n/a
Thanks for your reply Dan,

Don't worry, we can try locating the problem step by step. I suggest you
try make the SQL Express database attached into the SQLExpress instance or
any other instance temporarly for test to see whether it works. If it
works, we can make sure that the problem just focus on the database
connection's establishment.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: =?Utf-8?B?bXVzb3NkZXY=?= <mu*******@community.nospam>
References: <73**********************************@microsoft.co m>
<90**********************************@microsoft.co m>
<yq**************@TK2MSFTNGHUB02.phx.gbl>
>Subject: RE: IIS7 on Vista and SQLExpress problem
Date: Fri, 7 Sep 2007 02:00:02 -0700
t
>
Hi Steven,

Unfortunately, there is no UNC share involved - that's why I don't
understand it too well. VS, the website, the mdf, IIS7, firefox... all on
the
>C: drive of my laptop (Vista Ultimate).

Peter's suggestion sounds like it would break the SQL database in Visual
Studio? I still want to be able to run the site from VS as well for
debugging
>purposes.

Is it possible to make all this work, all I wanted to do was test my site
in
>IE6 :(
"Steven Cheng[MSFT]" wrote:
>Thanks for Peter's input.

Hi Dan,

My understanding is after you create new website virtual dir on the
Vista
>IIS7 box, it still point to the web application directory on original
development machine, through a UNC share. Is this your case?

If so, the error may be caused by the SQL Express database file is on
remote location. I suggest you perform the following test:

** copy the entire website to a local physical directory on the vista
box
>and configure IIS to use the local locaiton to test

** Or as Peter suggested, you can consider directly attach the database
file to the SQL Express instance on VISTA and let your asp.net
application
>(modify connectionstring) connect that attached database to see whether
it
>works.

If there is any other finding, please feel free to post here also.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.
>>

--------------------
>From: =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
<pb*******@yahoo.yohohhoandabottleofrum.com>
>References: <73**********************************@microsoft.co m>
Subject: RE: IIS7 on Vista and SQLExpress problem
Date: Thu, 6 Sep 2007 11:44:02 -0700

I believe this is because the auto-attach feature of SQLEXPRESS only
works
>for local connections. You will probably need to permanently attach
the
>MDF
>database file using the SQLExpress Manager or the appropriate T-SQL
Command.
>Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"musosdev" wrote:

Hi,

I wonder if someone could shed some light on this one for me.

I have developed a web app in VS2005 with the built in server. It
uses
>an
>sql database, everytihng works.

I need to test it across the network, so i've installed IIS7 on my
Vista
>machine and created a new website, point at the website's directory.
After I
>switched to the 'Classic .net' app pool, it shows up on the port.

However, the SQLExpress database is giving me an error...

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

The file in question exists, and the whole website directory has
Everyone
>Full Control permissions, with permission inheritance on, so that
should
>be
>fine.

The Visual Studio isntance of this isnt running (im not running
visual
>studio, the development server, or anything).

My web.config specifies the |DataDirectory|, and my file is in
App_Data
>- in
>fact, the database works fine when I run it through VS/Dev Server for
debugging, but it fails on IIS7.

What's going on?!! (and yes, my connection string does specify User
Instance=True.

Any help much appreciated.

Thanks

Dan

Sep 12 '07 #5

P: n/a
Hi Dan,

Any progress on this issue? Please feel free to post here if you need any
help on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: st*****@online.microsoft.com (Steven Cheng[MSFT])
Organization: Microsoft
Date: Wed, 12 Sep 2007 03:04:25 GMT
Subject: RE: IIS7 on Vista and SQLExpress problem
>
Thanks for your reply Dan,

Don't worry, we can try locating the problem step by step. I suggest you
try make the SQL Express database attached into the SQLExpress instance or
any other instance temporarly for test to see whether it works. If it
works, we can make sure that the problem just focus on the database
connection's establishment.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>>From: =?Utf-8?B?bXVzb3NkZXY=?= <mu*******@community.nospam>
References: <73**********************************@microsoft.co m>
<90**********************************@microsoft.c om>
<yq**************@TK2MSFTNGHUB02.phx.gbl>
>>Subject: RE: IIS7 on Vista and SQLExpress problem
Date: Fri, 7 Sep 2007 02:00:02 -0700
t
>>
Hi Steven,

Unfortunately, there is no UNC share involved - that's why I don't
understand it too well. VS, the website, the mdf, IIS7, firefox... all on
the
>>C: drive of my laptop (Vista Ultimate).

Peter's suggestion sounds like it would break the SQL database in Visual
Studio? I still want to be able to run the site from VS as well for
debugging
>>purposes.

Is it possible to make all this work, all I wanted to do was test my site
in
>>IE6 :(
"Steven Cheng[MSFT]" wrote:
>>Thanks for Peter's input.

Hi Dan,

My understanding is after you create new website virtual dir on the
Vista
>>IIS7 box, it still point to the web application directory on original
development machine, through a UNC share. Is this your case?

If so, the error may be caused by the SQL Express database file is on
remote location. I suggest you perform the following test:

** copy the entire website to a local physical directory on the vista
box
>>and configure IIS to use the local locaiton to test

** Or as Peter suggested, you can consider directly attach the database
file to the SQL Express instance on VISTA and let your asp.net
application
>>(modify connectionstring) connect that attached database to see whether
it
>>works.

If there is any other finding, please feel free to post here also.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.
>>>

--------------------

From: =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
<pb*******@yahoo.yohohhoandabottleofrum.com>
References: <73**********************************@microsoft.co m>
Subject: RE: IIS7 on Vista and SQLExpress problem
Date: Thu, 6 Sep 2007 11:44:02 -0700

I believe this is because the auto-attach feature of SQLEXPRESS only
works
>>for local connections. You will probably need to permanently attach
the
>>MDF
database file using the SQLExpress Manager or the appropriate T-SQL
Command.
Peter
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder: http://www.blogmetafinder.com

"musosdev" wrote:

Hi,

I wonder if someone could shed some light on this one for me.

I have developed a web app in VS2005 with the built in server. It
uses
>>an
sql database, everytihng works.

I need to test it across the network, so i've installed IIS7 on my
Vista
>>machine and created a new website, point at the website's directory.
After I
switched to the 'Classic .net' app pool, it shows up on the port.

However, the SQLExpress database is giving me an error...

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

The file in question exists, and the whole website directory has
Everyone
Full Control permissions, with permission inheritance on, so that
should
>>be
fine.

The Visual Studio isntance of this isnt running (im not running
visual
>>studio, the development server, or anything).

My web.config specifies the |DataDirectory|, and my file is in
App_Data
>>- in
fact, the database works fine when I run it through VS/Dev Server
for
>>debugging, but it fails on IIS7.

What's going on?!! (and yes, my connection string does specify User
Instance=True.

Any help much appreciated.

Thanks

Dan

Sep 14 '07 #6

This discussion thread is closed

Replies have been disabled for this discussion.