Re: Cannot open database requested in login

From: SQL Server Development Team [MSFT] (sqldev@microsoft.com)
Date: 12/16/02


From: "SQL Server Development Team [MSFT]" <sqldev@microsoft.com>
Date: Mon, 16 Dec 2002 10:58:15 -0800


The problem from your code looks like you're still trying to log in with a
standard security user. Assuming your goal is to use windows integrated
security (as from your original post) then leave out the username
altogether. Also you'll want to add the login that you're the application
under (for example, either your user account or the user account of the
ASP.NET service) as a login to SQL Server and with access to the
ITPSCustomers database.

For example, you could run the following in query analyzer:

exec sp_grantlogin DOMAIN\YourUserName
exec sp_grantdbaccess DOMAIN\YourUserName

and that should grant access to whatever account you're using.

--
-Richard Waymire
Group Program Manager, SQL Server
(rwaymi@microsoft.com)
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
"Paul" <paul@themedialounge.com> wrote in message
news:e#ZmKDSpCHA.1960@TK2MSFTNGP10...
> Ive just checked that and it is set to mixed mode.
>
> I was thinking about logins before.  Still doesnt work.
>
> I'm sick of this. I hate Microsoft.
>
>
> "Murali" <murali_12180@yahoo.com> wrote in message
> news:001b01c2a51f$5fb71b40$d4f82ecf@TK2MSFTNGXA11...
> > you sql server is in windows authentication mode, you
> > should set this mixed mode. in properties of yr sql server
> > you should see security tab, change authentication to "SQL
> > server and windows"
> >
> > Murali - NY
> > >-----Original Message-----
> > >I can see the option for WIndows Authentication and
> > another option for SQL
> > >Server Authentication.
> > >
> > >I cannot see an option for both.
> > >
> > >Could you be more specific?
> > >
> > >
> > >"Murali" <murali_12180@yahoo.com> wrote in message
> > >news:043f01c2a515$c4fc23b0$89f82ecf@TK2MSFTNGXA01...
> > >> goto sql server properties and in security change the
> > >> authentication to sql server and windows...
> > >>
> > >> Murali
> > >> >-----Original Message-----
> > >> >The db is definatly fine.  This is driving me nuts.
> > >> >
> > >> >WHy the hell can I connect with sql server
> > authentication
> > >> but not Windows?
> > >> >
> > >> >
> > >> >"Jobi" <johan.bijnens_n_o_s_p_a_m@alz.be> wrote in
> > message
> > >> >news:atkic2$1n7$1@reader10.wxs.nl...
> > >> >> Maybe the default-db for that user no longer exists
> > or
> > >> the user has
> > >> >nolonger
> > >> >> access to that db.
> > >> >> --attatch/restore could have that impact
> > >> >>
> > >> >> Jobi
> > >> >> "Paul" <paul@themedialounge.com> wrote in message
> > >> >> news:Om4V1JPpCHA.2360@TK2MSFTNGP09...
> > >> >> > I have used the following string to succesfully
> > >> connect to my SQL Server
> > >> >> > database :
> > >> >> >
> > >> >> > "Provider=SQLOLEDB.1;
> > >> >> > Password=monkey;
> > >> >> > Persist Security Info=True;
> > >> >> > User ID=VSdotNET;
> > >> >> > Initial Catalog=ITPSCustomers;
> > >> >> > Data Source=DELL\VSdotNET"
> > >> >> >
> > >> >> > The problem is that I do not want SQL Server
> > >> authentication so I opened
> > >> >up
> > >> >> > SQL Server, removed the login VBdotNET, added it
> > >> again and changed the
> > >> >> user
> > >> >> > authentication to Windows.  I then changed the
> > >> connection string to :
> > >> >> >
> > >> >> > "Provider=SQLOLEDB.1;
> > >> >> > Integrated Security=SSPI;
> > >> >> > Persist Security Info=False;
> > >> >> > Initial Catalog=ITPSCustomers;
> > >> >> > Data Source=DELL\VSdotNET"
> > >> >> >
> > >> >> > When I now run my web page I get the errors :
> > >> >> >
> > >> >> > System.Data.OleDb.OleDbException: Cannot open
> > >> database requested in
> > >> >login
> > >> >> > 'ITPSCustomers'. Login fails.
> > >> >> > at System.Data.OleDb.OleDbConnection.ProcessResults
> > >> (Int32 hr)
> > >> >> > at
> > >> System.Data.OleDb.OleDbConnection.InitializeProvider()
> > >> >> > at System.Data.OleDb.OleDbConnection.Open()
> > >> >> > at DreamweaverCtrls.DataSet.DoInit()
> > System.Exception:
> > >> >> > The DefaultView was requested but no tables yet
> > exist.
> > >> >> > at DreamweaverCtrls.DataSet.get_DefaultView()
> > >> >> >
> > >> >> > Can anyone help me out.
> > >> >> >
> > >> >> >
> > >> >>
> > >> >>
> > >> >
> > >> >
> > >> >.
> > >> >
> > >
> > >
> > >.
> > >
>
>


Relevant Pages

  • Re: Windows Authentication in asp.net 2005 to SQL Server?
    ... If the domains do not trust each other, Windows authentication is not going ... Basic authentication sometimes makes the need for Kerberos delegation go ... generic account to do the backend data stuff on our SQL Server. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Remote connection failed
    ... If you are going over a remote connection or are not logging ... into the domain where SQL Server is then no, Windows ... authentication won't work. ...
    (microsoft.public.sqlserver.connect)
  • Re: Trusted connections??
    ... implement role or user based security at the SQL Server. ... If the ASP.Net app controls what the user can request of the database then I ... I implement user authentication at the application and the application ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Changing passwords / Blocking SA login attempts
    ... I went into the Server Config properties and changed to Windows ... My login for Start and Run SQL server was in this format. ... I am supposing this was an SQL authentication, ...
    (microsoft.public.sqlserver.security)
  • Windows Authentication with IIS on separate machines
    ... Yes, setting Basic Authentication in IIS works, but the ... >in SQL server but doesn't work if user account was ... >imported from a Windows account. ...
    (microsoft.public.sqlserver.security)