Re: Login fails. Why?

From: Dan Guzman (danguzman@nospam-earthlink.net)
Date: 09/21/02


From: "Dan Guzman" <danguzman@nospam-earthlink.net>
Date: Sat, 21 Sep 2002 10:27:43 -0500


Apparently, the 'UserName' login has not been granted access to the
database. You can do this with Enterprise Manager or with the following
script in Query Analyzer:

    USE MyDatabase
    EXEC sp_adduser 'UserName'

The user will need permissions on referenced database objects, either
directly or via role membership.

--
Hope this helps.
Dan Guzman
SQL Server MVP
-----------------------
SQL FAQ links (courtesy  Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------
"C.G." <chris@cyberjock4hire.com> wrote in message
news:393001c260ad$c65f2c90$37ef2ecf@TKMSFTNGXA13...
> I'm running a dev version of my company's website on my
> laptop (Win2kAdv server, MS SQL Server 2K) It's an exact
> replica of the original DB but I'm getting this...
>
> Error Type:
> Microsoft OLE DB Provider for ODBC Drivers (0x80004005)
> [Microsoft][ODBC SQL Server Driver][SQL Server]Cannot open
> database requested in login 'CompanyDB'. Login fails.
> /Common/conndatabase.asp, line 29
>
> Line 29: conn.Open
> connString "DSN=CompanyDB;UID=UserName;PWD=PassWord"
>
> What am I doing wrong? Where are all the places I need to
> check for this user's permissions?
>
> TIA!
>


Relevant Pages

  • Re: System Administrator Implied Permissions
    ... > sa login, it assigns it the System Administrator fixed ... > Now, given this, why does SQL Server ... in each database is always a member of the public and db_owner roles. ... Other sysadmin role members have the exact same ...
    (microsoft.public.sqlserver.security)
  • Re: No db access after publishing web site
    ... GRANT UPDATE TO ... If I detach and attach this database on a different PC (according that PC ... Cannot open database "pago" requested by the login. ... Are you detaching/attaching the SQL Server Express database correctly ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Enter user name, enter password, then press enter...
    ... What do you do when the customer asks that the database login in be the same ... username and password to use all of the stuff that she is permitted to use. ... I have implemented this type of security for Access, VB, and Web Based ASP ...
    (microsoft.public.access.forms)
  • RE: Receiving JDBC error when executing program - Login failed for user sa
    ... says we're using 'sa' so I would think that's the username being passed in. ... | I am receiving the following error when attempting to run my database ... I tried to login the 'sa' account ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: Dynamic SQL
    ... Don't need to login to the database. ... OF course entering username N00bHax0r') will cause an error. ... // is the Validators good for this ????? ...
    (microsoft.public.dotnet.framework.aspnet)