OUCH... got my first taste of "your code is OLD, and needs to be updated..." of course at the most inopportune time (oh well).
So, I don't know the 1st thing about 32 and 64; never-the-less, I update the code in a declare statement
Code:
If Win64 Then
Declare PtrSafe Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As LongLong) As LongLong
Else
Declare Function apiGetUserName Lib "advapi32.dll" Alias _
"GetUserNameA" (ByVal lpBuffer As String, nSize As Long) As Long
End If
the second portion (the original code) worked fine, but the first (Declare PtrSafe Function...) returned this error: expected sub or function...
HUH?
(you should also know, the error occurred on a 64bit machine, the one that I use (for programming) is only 32-bit; the database will be used on both)
many thaks in advance,
mark