Using NT Authentication in SQL Server using ADO.NE

Butirrerne

New Member
Anyone have a way to use NT Authentication in SQL Server using ADO.NET. What would a valid connection string be? I'm trying to pass in the uid and pwd from the Server Variables collection. Any ideas? Can't use a DSN with the SQL Server Provider.I actually figured out how to do this yesterday, I don't know if it will work for you as I'm just using plan old ASP, but it could point you in the right direction.<BR><BR>dim oConn<BR>Set oConn = Server.CreateObject("ADODB.connection")<BR>set varnetid = Request.ServerVariables ("Auth_User")<BR>set varpwd = Request.ServerVariables ("Auth_Password")<BR>oConn.ConnectionString = "Provider=SQLOLEDB; Data Source=machinename; Initial Catalog=Databasename; User ID=" & varnetid & "; Password=" & varpwd & "; Integrated Security=SSPI"<BR>oConn.Open<BR><BR>I hope that can at least point you in a good direction.
 
Back
Top