Results 1 to 3 of 3

Thread: Need help with do loop until

  1. #1
    Pauwl
    Guest

    Need help with do loop until

    ok here goes. I have the following code for checking if a user exists in a NT domain:

    Code:
    if NetUserGetInfo(bServer(0), bUsername(0), 3, lpBuf) = ERR_Success) then
            Dim lpBuf As Long
            Dim ui3 As USER_INFO_3
            Dim bServer() As Byte, bUsername() As Byte
            bServer = "\\tempsrv" & vbNullChar
            bUsername = username & vbNullChar
            Call MoveMemory(ui3, ByVal lpBuf, Len(ui3))
    msgbox "username " & username & " already exists"
    else
    blabla create user
    end if
    and the following code for putting a follownumber at the end of the username:

    Code:
    username = Left(username, Len(username) - 1) & Right(username, 1) + 1
    how can i put this in a loop that if username1 and username2 already exist it creates a username username3 for example???

    I hope you know what i mean

  2. #2
    Pauwl
    Guest
    no 1???
    I'm pretty sure there are a lot of "loop" cracks over here

  3. #3
    Pauwl
    Guest
    still not figured out yet

    can anyone send me in the right direction?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width