Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Login failed for user

Author  Topic 

bash101
Starting Member

4 Posts

Posted - 2007-10-22 : 10:07:11
Hi Everyone,

I have the following connection string type.

Driver={SQL Server};Server=servername;Database=databasename;Uid=username;Pwd=;

The Server, Database, and the Uid fields have been filled in. The Pwd has been left empty. Now I can connect to my database, using SQL Server Management Studio Express (SQL SERVER and Windows Authentication Mode), but cannot do so from an ASP page, using the above connection string. I get the following error:

Microsoft OLE DB Provider for ODBC Drivers error '80040e4d'

[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user ''.

Is it because I have not given the Pwd, if so how would I set this. I did not enter a password when connecting using SQL Server Management Studio Express.





Kristen
Test

22859 Posts

Posted - 2007-10-22 : 10:42:28
Maybe your user has made a connection using Windows Authentication, instead of a SQL connection and thus ignored the User/Password parts of the Connection string?

Kristen
Go to Top of Page

bash101
Starting Member

4 Posts

Posted - 2007-10-22 : 11:57:24
Thanks for the reply.

It uses Windows Authentication to connect to the database using SQL Server Management Studio Express, and it works fine. There is no Username, Password needed, when using SQL Server Management Studio Express. Once I connect using Studio Express it shows servername (SQL Server 9.0.1399 - CMMC) in the left top server node (in Object Explorer).

If I omit the password from connection string, it gives me a [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'CMMC' error.

If I take out both the Uid, and Pwd from the connection string then it gives me an [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'WEBDEV\IUSR_CMMCMF1' error.

The user is CMMC, and connection is Windows Authentication, what should the connection string be?

Go to Top of Page

ratheeshknair
Posting Yak Master

129 Posts

Posted - 2007-10-22 : 13:28:38
Have u given any name to ur system???

RKNAIR
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-10-22 : 13:58:42
The connection string that you have posted is using SQL authentication and not Windows authentication as you have mentioned. So you are providing an incorrect userid or password for the SQL account. If you intend to use Windows authentication, then your connection string must change.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-10-22 : 13:59:07
quote:
Originally posted by ratheeshknair

Have u given any name to ur system???



Every system has a name, so what are you referring to?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

bash101
Starting Member

4 Posts

Posted - 2007-10-23 : 07:53:30
It uses Windows Authentication to connect to the database using SQL Server Management Studio Express, and it works fine. There is no Username, Password needed, when using SQL Server Management Studio Express. Once I connect using Studio Express it shows servername (SQL Server 9.0.1399 - CMMC) in the left top server node (in Object Explorer).

If I omit the password from connection string, it gives me a [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'CMMC' error.

If I take out both the Uid, and Pwd from the connection string then it gives me an [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'WEBDEV\IUSR_CMMCMF1' error.

The user is CMMC, and connection is Windows Authentication, what should the connection string be?
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-10-23 : 08:54:43
www.connectionstrings.com



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2007-10-23 : 09:05:43
"The user is CMMC, and connection is Windows Authentication, what should the connection string be?"

Sounds to me like you are trying to mix Windows Authentication and SQL logins.

If you want Windows Authentication it looks like its going to use WEBDEV\IUSR_CMMCMF - and you should use a connection string for "Trusted connection".

If you want to use SQL Login then you can specify any valid UserID and Password (and SQL Server must be set up to access SQL Logins, in additional to Windows Authentication)

Kristen
Go to Top of Page
   

- Advertisement -