GetUserName stopped working, please help! 
Author Message
 GetUserName stopped working, please help!

Hi, I'm new to VB (and Access) and I'm trying to use GetUserName to get the
user's ID. It was working, but suddenly stopped. I've checked several pc's.
What could have gone wrong? Do you know exactly where this username is
coming from? I'm guessing the Windows logon. Or is it coming from Novell?
(Maybe someone changed something on the system.) Any help is appreciated!
Thanks!



Fri, 08 Dec 2000 03:00:00 GMT  
 GetUserName stopped working, please help!

ick.....

Option Explicit
Option Base 0
Private baBuffer(0 To 255) As Byte
Private lBufferLen As Long
Private Declare Function GetUserName _
Lib "kernel32.dll" Alias "GetUserNameA" ( _
    ByRef lpBuffer As Byte, _
    ByVal nSize As Long _
) As Long

Private Sub Fom_Load
    lBufferLen = GetUserName(baBuffer(0), 256)
    MsgBox Left$(StrConv(baBuffer, vbUnicode), lBufferLen)
End Sub



Mon, 11 Dec 2000 03:00:00 GMT  
 GetUserName stopped working, please help!

I appreciate the code, but it looks very similar to what I'm already using.
Do you know where the username is actually coming from, i.e. the network
login, the Windows login, somewhere in the Windows registry... Thanks for
answering, I'll try your version.



Tue, 12 Dec 2000 03:00:00 GMT  
 GetUserName stopped working, please help!

On Thu, 25 Jun 1998 23:11:46 -0400, "Timothy J. Bruce"

Quote:

>Option Explicit
>Option Base 0
>Private baBuffer(0 To 255) As Byte
>Private lBufferLen As Long
>Private Declare Function GetUserName _
>Lib "kernel32.dll" Alias "GetUserNameA" ( _
>    ByRef lpBuffer As Byte, _
>    ByVal nSize As Long _
>) As Long

>Private Sub Fom_Load
>    lBufferLen = GetUserName(baBuffer(0), 256)
>    MsgBox Left$(StrConv(baBuffer, vbUnicode), lBufferLen)
>End Sub

Don't try to make life harder:
For full understanding - just copy win32.hlp file (Full Documentation
about Win32 Functions)

--------------------------------------------------
Option Explicit
Private Declare Function GetUserName Lib "kernel32.dll" Alias
"GetUserNameA" ( ByVal lpBuffer As String,  ByVal nSize As Long ) As
Long

Private Sub Fom_Load
Dim Temp$, Res&
        Temp=space(256)
        res= GetUserName(Temp, 256)
        MsgBox Left(Temp,Res)
End Sub



Wed, 13 Dec 2000 03:00:00 GMT  
 GetUserName stopped working, please help!

I tried the code that Alik suggested but I got the error 453 "Can't find DLL
entry point GetUserNameA in kernel32.dll" when I try to execute:

Res = GetUserName(Temp, 256)

Quote:

>Don't try to make life harder:
>For full understanding - just copy win32.hlp file (Full Documentation
>about Win32 Functions)

>--------------------------------------------------
>Option Explicit
>Private Declare Function GetUserName Lib "kernel32.dll" Alias
>"GetUserNameA" ( ByVal lpBuffer As String,  ByVal nSize As Long ) As
>Long

>Private Sub Fom_Load
>Dim Temp$, Res&
> Temp=space(256)
> res= GetUserName(Temp, 256)
> MsgBox Left(Temp,Res)
>End Sub



Sun, 17 Dec 2000 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Please Help: Visual Basic stopped working in Chinese Windows95

2. Please Help! VB4 stopped working in Chinese Win95

3. PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP, PLEASE HELP,

4. Please, Please, Please I need help working with dates

5. API call to GetUserName not working in VB5.0

6. Advapi32.dll -- GetUserName not working

7. Advapi32.dll -- GetUserName not working

8. Can anyone HELP me PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE PLEASE

9. A2000/Win2000 online help stops working

10. Help: Query stops working when VB4 -> VB5

11. help:query stopped working in 4.0, error 13

12. Help!! Error Trapping stopped working

 

 
Powered by phpBB® Forum Software