I work on a few projects with a front end recently moved to vb.net, the back-end's remain in access .accdb
format.
With an Access front end I was able to set up some data macros that captured the username of a person making changes and record them in an audit table, it looks like it will be a little harder with a .net front-end.
Is there any way to pass this information from the front end to the database ? Or is there a method of making the back-end look at the function that is stored there (It doesn't seem to work at the moment)
This is the code I have in the back
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Function GetUserName() As String
' Returns the network login name
Dim lngLen As Long, lngX As Long
Dim strUserName 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
End Function
I have a public function doing the same in the front-end, also called getusername()