Re: Windows authentication mode



Alan T explained :
How do I get the user name of the machine to login the SQL Server 2000 if the database server is Windows Authentication mode?

Actually you need to change the connection string to select windows authentication and every thing is taken care for you by the OLEDB driver automatically. EG.

connection string that uses the windows authentication mode and does not require a user name or password to login.

Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=MY_DATABASE;Data Source=MY_SQLServer

MY_DATABASE is a dummy name here which you must change to an existing database on your server, the same upplys for the MY_SQLServer it must be changed to an existing SQLServer.

Now If you do keep extra rights for your application in any kind of form (DB Table, external files etc) and you need to know the user logged in then you can use the function provided by Mr Brian Bushay or you coold simple request the user name from the server executing the SQL command
SELECT USER_NAME()


Regards
Yannis.


.



Relevant Pages

  • Re: User Not associated with a trusted SQL Server connection.
    ... What is the exact connection string ... the test server connection string, could you please provide that one as ... The SQL ... > server is configured for SQL and Windows authentication, ...
    (microsoft.public.dotnet.security)
  • Re: Authentication to server with SSL through firewall
    ... > 1.The client is my Web Server. ... > applications typically don't support Windows Authentication. ... The question about this case is whether the connection string is ... > establishing a connection to SQL Server using Standard Security. ...
    (microsoft.public.sqlserver.security)
  • Re: SQL 2008 remote Management Studio connection
    ... right-click the server name and then click Properties. ... is SQL Server and Windows Authentication mode selected? ... If the server was installed in Windows Authentication mode, and then changed to SQL Server and Windows Authentication mode then the sa account was disabled. ...
    (microsoft.public.sqlserver.connect)
  • Re: Login failed for user (null). Reason: Not associated with a trusted SQL Server connection.
    ... Remove the integrated security info from the connection string. ... Server to use Windows Authentication, not SQL Server Authentication. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: OLE DB connection string in SharePoint for Sybase ASA
    ... I wen to the Sybase site and found a reference to Connection String ... > where I WANT it to say Database Connections. ... > and up pops a Data Source Properties Window. ... > Server Error: An error occurred while retrieving the list of Databases ...
    (microsoft.public.frontpage.client)