How can I send an ODBC connection string to an SQL server if the user is authenticated by Active Directory?
Technologies:SQL Server 2008, .NET 2008, Active Directory
I'm trying to send a connection string via my application to the SQL Server to authenticate a username开发者_如何学JAVA and password that is stored in Active Directory, not locally on the db server.
Unfortunately, this isn't working because when I send the connection string, it only checks the SQL server local users, instead of checking the credentials against active directory. Does anyone know of a solution?
Currently using ODBC to make the connection.
You cannot make a connection to SQL Server in this way. SQL Server supports only two kinds of connections:
SQL Login, where to connect, you supply it with the username and password of a SQL Login (i.e., not a Windows/AD Logon) defined on that SQL Server. or,
A Trusted Connection, where to connect, you supply it with NO username or password and it connects you to a session based on your current Windows session's security context (assuming you are so authorized).
Those are your only choices. If you want to connect to SQL Server as a different Windows/AD security context, you will have to create a Windows session with that context first.
精彩评论