get the userid in a project

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi, thanks in advance for the help, In a project I want to get the userid
with the client is accesing the MSDE, if I use currenuser command I alway get
admin, even if I open the datebase with difference userid

Any Advice, thanks
 
Hi, thanks in advance for the help, In a project I want to get the
userid with the client is accesing the MSDE, if I use currenuser
command I alway get admin, even if I open the datebase with difference
userid

SELECT SYSTEM_USER


This should work from an Access project:


Public Sub WhoAmI()
Dim adoSQL As String
Dim rst As ADODB.Recordset

' this is how to get it
adoSQL = "SELECT SYSTEM_USER"

' look it up
Set rst = New ADODB.Recordset
rst.Open adoSQL, CurrentProject.Connection, _
adOpenForwardOnly, adLockReadOnly, _
adCmdText

' and do something useful with the result...
MsgBox rst.Fields(0), vbInformation, "Who am I?"

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top