Solved

NetUserGetGroups0 returns 234 and loops forever

Posted on 2000-03-03
6
267 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Revamp Your Training Process

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action.

 
LVL 1

Accepted Solution

by:
karlww earned 250 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

Technology Partners: 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!

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month10 days, 15 hours left to enroll

631 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