|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Polling Internal user account using VBI currently have a database that has two types of users built in (using the access system). Only two actual usernames are created of "admin" and "user". I also have a module that polls the operating system to get the windows user, as well as time, and date. Since multiple people will have access to the admin user, I would like to log the login type to my login log. How would I poll the access username? If it helps I attached my module code below. Option Compare Database Public Declare Function apiGetUserName Lib "advapi32.dll" Alias "GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long Function GetUserName() As String ' Returns the network login name Dim lngLen As Long, lngX As Long Dim strUserName As String Dim v_user As String strUserName = String$(254, 0) lngLen = 255 lngX = apiGetUserName(strUserName, lngLen) If lngX <> 0 Then GetUserName = Left$(strUserName, lngLen - 1) Else GetUserName = "" End If v_user = GetUserName sqlInsertStatement = "Insert into UserLog([UserName],[LoginDate],[LoginTime]) Values('" & v_user & "','" & Format(Date, "mm\/dd\/yyyy") & "','" & Time & "')" DoCmd.SetWarnings False DoCmd.RunSQL sqlInsertStatement DoCmd.SetWarnings True End Function requ***@gmail.com wrote:
> Hello, Use the CurrentUser() function.> > I currently have a database that has two types of users built in > (using the access system). Only two actual usernames are created of > "admin" and "user". I also have a module that polls the operating > system to get the windows user, as well as time, and date. Since > multiple people will have access to the admin user, I would like to > log the login type to my login log. How would I poll the access > username? -- Joan Wild Microsoft Access MVP
How to add the security back to the normal database?
Multi users in one form Use Level Security lockout splitting the database and securing the back-end file? Using User Level Security Wizard ActiveX component can't create object. Password protection on Access VB Project multi user Help with Can any one please explain me Access Security |
|||||||||||||||||||||||