Showing posts with label integrated. Show all posts
Showing posts with label integrated. Show all posts

Thursday, March 8, 2012

Connection to SQL Server

Hello,

I have a web application that queries data from a SQL Server. For develoment, I used integrated security to connect to the database. Now, I would like to put the application on a server and connect to the SQL Server using a username/password.

Here is my connection string


"data source=CHRISANNE;initial catalog=TAPTest;uid=TapWEBUser;pwd=myPassword"

When I attempt to connect to the SQL Server, I get the following error:
Connection failed:
SQLState: '28000'
SQL Server Error: 18456
[Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'TapWEBUser'

The user profile was created and was added to the database with public, db_datareader, and db_datawriter permissions. I'm not sure what I am doing wrong. Does anyone have any suggestions? Thanks in advance!

TimCan you login to the database using that user name and password using Query Analyzer? I would try "User ID" rather than "uid". I do not see uid in the documentation.|||I attempted to login to the database using the Query Analyzer...no luck.

I recieved the following error.

Msg 18456, Level 16, State 1
Login failed for user 'TapWEBUser'

Also, I changed the uid to User ID....also no luck. Any more suggestions? Thanks.|||Well, then TapWEBUser is not set up correctly, or you are using the wrong password, or some combination. Until you can log into Query Analyzer, you have a SQL user problem unrelated to ASP.NET.

I would try and reset the users password and give it another shot.|||Ok...thanks for the advise. I found the problem. The dba gave me the wrong password.

Thanks for your help.

Connection to SQL Express ONLY with integrated security but WITHOUT domain

Does anybody know if it is possible to establish a connection to an sql express instance only with integrated security when this express instance is running on XP which is NOT part of a domain?

Thanks,

Klaus

If the SQL Express machine isn't connected to a domain then I don't believe Kerberos authentication will work but NTLM authentication should work. If the client application is running on the same machine as SQL Express then you should be able to straightforwardly give a user account local to the machine permission to connect to SQL Express (machine administrators will have it by default). If you're connecting from off-box then I think you'll need to setup the same account (same user name & password) on the remote machine.

Hope that helps.

Vaughn