A
Archidrb
This morning users in my database started getting this message hen opening
the database. I use an autoexec command to start the database and open a
(splash scrren). This form that opens shows the most up to date version
number, so I know right there the ODBC connection to the SQL Server backend
is working. Then when that form closes the main menu opens.
As part of the main menu, a bit of code goes out and grabs the user's LAN ID
and populates it into a hidden field on the main menu. This field then
allows the user to update records and their name automatically populates.
This name also limits access to certain bits of the database using macros.
Each users gets this error four times, then the VBA de-bugging window opens
and the code attached to this LAN ID process opens. It highlights the line
containing the name of the function - which of course had not to do with a
'Date'.
Here is the code, I removed the (green) notes to save space and reading time.
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function fOSUserName() As String
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
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function
Did Microsoft release an update or hotfix that is causing this problem? Any
other ideas?
the database. I use an autoexec command to start the database and open a
(splash scrren). This form that opens shows the most up to date version
number, so I know right there the ODBC connection to the SQL Server backend
is working. Then when that form closes the main menu opens.
As part of the main menu, a bit of code goes out and grabs the user's LAN ID
and populates it into a hidden field on the main menu. This field then
allows the user to update records and their name automatically populates.
This name also limits access to certain bits of the database using macros.
Each users gets this error four times, then the VBA de-bugging window opens
and the code attached to this LAN ID process opens. It highlights the line
containing the name of the function - which of course had not to do with a
'Date'.
Here is the code, I removed the (green) notes to save space and reading time.
Private Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Function fOSUserName() As String
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
fOSUserName = Left$(strUserName, lngLen - 1)
Else
fOSUserName = vbNullString
End If
End Function
Did Microsoft release an update or hotfix that is causing this problem? Any
other ideas?