Re: Windows authentication mode
- From: yannis <none@xxxxxxxxxx>
- Date: Wed, 11 Apr 2007 14:37:10 +0300
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.
.
- References:
- Windows authentication mode
- From: Alan T
- Windows authentication mode
- Prev by Date: Re: Run script from ADO components - if possible
- Next by Date: Re: Run script from ADO components - if possible
- Previous by thread: Re: Windows authentication mode
- Next by thread: Deleting detail, master is deleted too !
- Index(es):
Relevant Pages
|