Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

NetUserGetGroups0 returns 234 and loops forever

Posted on 2000-03-03
6
Medium Priority
?
271 Views
Last Modified: 2008-03-17
I using the EnumerateGroups function from MSDN article Q159498 and for certain user accounts, NetUserGetGroups0 returns a 234 and loops forever.  If I take out the Do..Loop then it does not display all of the user's groups.

Using NT4 workstation on NT4 Domain.
0
Comment
Question by:jfunderb
  • 3
  • 2
6 Comments
 
LVL 70

Expert Comment

by:Éric Moreau
ID: 2581011
0
 

Author Comment

by:jfunderb
ID: 2581227
They have the exact same code that I have.  But need to know what this 234 means and how to get around it.  Here's a piece of the code with very brief comments.  Maybe someone can expand on it a little...

       If Result <> 0 And Result <> 234 Then    ' 234 means multiple reads
                                                ' required
         Debug.Print "Error " & Result & " enumerating group " & EntriesRead & " of " & TotalEntries
         EnumerateGroups = 123456
         Exit Function
       End If
0
 

Author Comment

by:jfunderb
ID: 2581232
Adjusted points to 250
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Accepted Solution

by:
karlww earned 1000 total points
ID: 2581520
I believe you need to keep increasing your requested buffer size.  Consider this snipit for NetServerEnum;
    lngInfoLevel = 101
    lngMaxLen = 0
    lngServerType = SV_TYPE_ALL
    Do
        '//Increase the buffer size
        lngMaxLen = lngMaxLen + 1024
        '//Call to enum
        lngRC = NetServerEnum(ByVal strMachine, _
                              lngInfoLevel, _
                              lngBuffer, _
                              lngMaxLen, _
                              lngEntriesRead, _
                              lngTotalEntries, _
                              lngServerType, _
                              ByVal 0&, _
                              lngResumeHandle _
                              )
        '//Check for sucess-- otherwise we need to free the buffer
        If CBool(lngRC) Then NetApiBufferFree lngBuffer
    Loop While lngRC = 234    
    '//now loop thru
    ReDim ServerList(0 To lngEntriesRead - 1) As String
0
 

Author Comment

by:jfunderb
ID: 2581649
Your exactly right.  I was getting a little immpaientent, so I called Microsoft and they told me the same thing - increase the buffer size.  By adding this line it seems to work...

BufLen = 65335

Thanks!
0
 
LVL 1

Expert Comment

by:karlww
ID: 2581734
You're welocme!
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

926 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question