Groups | Blog | Home
all groups > sql server (microsoft) > january 2007 >

sql server (microsoft) : Rather urgent: Cannot open user default database. Login failed.


JimCinLA
1/16/2007 10:48:43 AM
On an ASP.Net 2.0 appliaction, I use ASPNETDB.mdf in the project's
App_Data subdirectory for forms authentication. This works fine inside

Visual Studio 2005.

When I deploy the application to an IIS server on the same computer,
I cannot open ASPNETDB.mdf. I get the usual message:

Cannot open user default database. Login failed.

On that particular computer, I have MS SQL 2005 Express installed.

I assume the solution is an easy one. It may be that ASPNETDB.mdf
should be attached to the database server for use outside
Visual Studio, but I just can't get there. Also, what settings should
be made, assuming it should be attached? For instance, do I add
[computer name]\ASPNET as a user for ASPNETDB.mdf?

Thanks in advance for any help!
m.bohse NO[at]SPAM quest-consultants.com
1/18/2007 6:54:08 PM

Jim,

I think your problem is that the ASP.Net user is trying to connect
directly to your database while the default database is a different
database (most probably master). Check in Enterprise Manager the
properties for the login and adjust the default database. That should
fix the problem.
Markus
AddThis Social Bookmark Button