Login failed for user

From: Andy Sjostrom (andynospam_at_businessanyplace.net)
Date: 05/23/03


Date: Fri, 23 May 2003 11:55:25 +0200


I have a problem with accessing my database. I get the error message: "Login
failed for user 'SQLServerCEUser'."
My environment is:
Windows 2003
SQL Server 2000 SP3

I have set up the SQL Server to mixed mode (SQL Server and Windows)
authentication.
I have created a user called "SQLServerCEUser" on my server.
I have created a login for that user and given it access to my database
(dbo).
I have even tried to add the user to the NT group Administrators and all SQL
Server admin groups.
If I use the sa account and password it all works fine.

I try to run the following code from a regular Windows Forms app:
Dim connectionstring = "Data Source=myserver;Initial
Catalog=Northwind;uid=SQLServerCEUser;password=password;"

Dim cn As New SqlConnection(connectionstring)

Dim da As New SqlDataAdapter("SELECT * FROM Employees", cn)

Dim ds As New DataSet

Try

cn.Open()

da.Fill(ds)

Catch ex As SqlException

Finally

End Try

It works using the connectionstring:
Dim connectionstring = "Data Source=myserver;Initial
Catalog=Northwind;uid=sa;password=thisisnotmysapassword;"

When I look at the user's permissions from Enterprise Manager, it seems as
if the user has no permissions at all.

What am I doing wrong here? Any help much appreciated!

Andy Sjostrom
MS MVP - Mobile Devices



Relevant Pages

  • Re: Slow booting xp home.
    ... Changing the boot order to boot first from your hard disk might save you a half second, but you won't be able to boot from a CD until you change it back - and the time spent to do that will erase any previous time saved. ... 2- Consider what software you really want to start with Windows and also how you've configured your applications at startup ... Installing and Registering Visual Studio Express Editions Smart Device ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: login 101..
    ... On Windows 2003, SQL Server 2005 can enforce the Windows password complexity ... Windows authentication - SQL Server uses a special protocol to ask ... user is in the list of allowed logins, ...
    (microsoft.public.sqlserver.security)
  • RE: How to create a trusted connection
    ... You need to grant access for the Windows login by referring to the books ... is set to use Windows authentication to be able to do trusted connection. ... There are two modes of authentication in SQL Server: ...
    (microsoft.public.sqlserver.security)
  • Re: Windows NT user or group not found.
    ... out what SQL Server thinks the login name is vs. what Windows thinks the ... When the SQL Server collation and the Windows collation are different, ... The following example uses the Param2 parameter to get the SID from Windows ...
    (microsoft.public.sqlserver.connect)
  • RE: How to create a trusted connection
    ... What do you mean by "creating a Windows login"? ... To login SQL Server 2000 using trusted connection, grant the Windows ... Group" in SQL Server Books Online to get the concept, ...
    (microsoft.public.sqlserver.security)