to get the user currently logged on to the database

  • Thread starter Thread starter Trainee
  • Start date Start date
T

Trainee

hi

i am using OleDbSchemaGuid.Schemata to return the users logged on to a
database but this method returns all the users but i need to know the user
who is currently logged in to that database is that possible??????

Avinash
 
Hi,

I guess it will be simple to get the username from the connection
string :)
Assuming connection string following same convection

"Provider=.. UID=...Pwd=...."

HTH
Kalpesh
 
This might help if it is in your connectionstring, but what if it is not?
What if there is a Windows authentication?

Sorry, I don't have the answer to that....

Cheers
Christiaan
 
Which DB ? Generally you can use a SQL function that returns the current
user such as CurrentUser in Access or SUSER_SNAME in SQL Server etc...
 
Back
Top