SQL authentication attempt ignored

M

murphy

I have a db server machine B set up with MSDE using mixed security.
From client machine A, I can run a .net windows forms app to connect to
a database on B using SQL authentication.
From an asp.net app client A, using the same connection string, I can
not connect. The event log on B shows:

Logon Failure:
Reason: Unknown user name or bad password
User Name: ASPNET
Domain: MYDEV
Logon Type: 3
Logon Process: NtLmSsp
Authentication Package: MICROSOFT_AUTHENTICATION_PACKAGE_V1_0
Workstation Name: MYDEV

This makes me think that for some reason, windows authentication is
being used instead.

My connection string:
Data Source=xy-mct01;Initial Catalog=xy;User ID=qxy;
Password=qxy;Network Library=DBMSSOCN;

Any ideas?

Thanks!
 
W

W.G. Ryan eMVP

Verify that you're using the connection that you think you are and also
verify that the username and password is correct - ie try it from the
winforms app and see if it works there.
 
M

murphy

Thanks,

Yes it works from a winforms app and I think I'm using the connection I
intend to. Here is the code. It fails at conn.Open().

SqlConnection conn = new SqlConnection("Data Source=qxyhost;Initial
Catalog=qxy;User ID=quser;Password=quser;Network Library=DBMSSOCN;");
conn.Open();

Is the server with SQL potentially set up to not allow remote access
with out windows authentication? For instance,

Client A is executing the above code
- Conn.open causes a socket to be openned on server B
- Server B is configured to challenge
- This causes server A to respond with its credentials: ASPNET user
from server A
- Server B says: don't know ya
I don't know if it's possible to configure Server B to do that. Ideas?
 
W

William \(Bill\) Vaughn

Sure, by default SQL Server only permits authentication via Windows
credentials. You have to enable "mixed mode" security to get it to accept
SQL Server login credentials.

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
 
M

murphy

Good point. But SQL Server is in mixed mode. The event log entry
seems to indicate the connection attempt is not making it to SQL server
anyway.

Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top