Results 1 to 2 of 2
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i always find multi-dimensional arrays a bit challengining

    the data is not binding to my multi-array.
    im reading data from AD (LDAP) and wanting to store in a muli-dimensional array.
    its going to the next record however just not storing or in my array.
    the result is its always set to first valid record.
    i do get a <subscript out of range> error

    any ideas?

    diana



    Code:
    Dim i As Long
    Dim arrStaff()
    
    Set objRecordSet = objCommand.Execute
    
    While Not objRecordSet.EOF
    
        intUAC = objRecordSet.Fields("userAccountControl")
    
        If intUAC And ADS_UF_ACCOUNTDISABLE Then
    
         ' account is disabled, ignore it
    
    
         Else
    
            On Error Resume Next
          
            strADLogon = "": strADLogon = objRecordSet.Fields("sAMAccountName")
            
            'data filtering      
            lngValidPayrollNumber = Val(strADLogon)
            
            If lngValidPayrollNumber <> 0 Then
                  
                ReDim Preserve arrStaff(i, 5)         
    
                arrStaff(i, 0) = objRecordSet.Fields("sAMAccountName")
                arrStaff(i, 1) = objRecordSet.Fields("givenName")
                arrStaff(i, 2) = objRecordSet.Fields("sn")
                arrStaff(i, 3) = objRecordSet.Fields("initials")
                arrStaff(i, 4) = objRecordSet.Fields("displayName")
    
            End If
    
        End If
    
        objRecordSet.movenext
    
     Wend

  2. #2
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,191
    Thanks
    48
    Thanked 986 Times in 916 Posts
    Double post?

    cheers, Paul

Posting Permissions

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